Identifying database request sources in multi-database systems

ABSTRACT

Recovering from a failure of a soon-to-fail database system among a plurality of database systems in a multi-database system in processing a request submitted to the multi-database system through a multi-database system session is accomplished. A query band is created for the request. The query band is defined to be an identifier that uniquely identifies the session and the request among the plurality of sessions and plurality of requests being processed by the multi-database system at the time that the request was submitted. The query band is attached to a transaction issued by the multi-database system to the soon-to-fail database system to execute the query. The status concerning execution of the transaction is reported by the soon-to-fail database system. The status includes the query band. The status is logged. The failure of the soon-to-fail database system is detected. The state of the soon-to-fail database system is reconstructed from the logged status as the state related to the processing of the transaction using the query band. The reconstructed state is used to continue processing of the transaction by an alternative database system. The alternative database system is one of the plurality of database systems in the multi-database system. The request is processed to produce a result and the result is stored.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation-in-part of U.S. patent applicationSer. No. 11/254,374, entitled Identifying Database Request Sources,filed on Oct. 20, 2005 now U.S. Pat. No. 8,280,867. This application isrelated to U.S. patent application Ser. No. 10/730,348, filed Dec. 8,2003, entitled Administering the Workload of a Database System UsingFeedback, by Douglas P. Brown, Anita Richards, Bhashyam Ramesh, CarolineM. Ballinger and Richard D. Glick; this application is related to U.S.patent application Ser. No. 10/786,448, filed Feb. 25, 2004, entitledGuiding the Development of Workload Group Definition Classifications, byDouglas P. Brown, Bhashyam Ramesh and Anita Richards; this applicationis related to U.S. patent application Ser. No. 10/889,796, filed Jul.13, 2004, entitled Administering Workload Groups, by Douglas P. Brown,is Anita Richards, and Bhashyam Ramesh; this application is related toU.S. patent application Ser. No. 10/915,609, filed Jul. 13, 2004,entitled Regulating the Workload of a Database System, by Douglas P.Brown, Bhashyam Ramesh, and Anita Richards.

BACKGROUND

It is often important to identify the source of a request, such as aquery, sent to a database management system (DBMS). Such information hasmany uses. For example, source information enables accounting todetermine the share of a DBMS's resources that are consumed by aparticular source. That information may be used for a number ofpurposes: (1) to charge back to the source a portion of the DBMS costs;(2) to identify, in a long-term-historical sense, the amount of work andthe number of requests that come from each source so that performancetuning can be better focused to the largest, or otherwise mostimportant, consumers as well as providing valuable insight into capacityplanning as different workloads grow at different rates and, as aconsequence, have different impacts on system sizing; (3) to identify,in real-time or recent historical terms, the precise source of a requestso that if the request is determined to be problematic, it can beresolved or at least better understood by the database administrator(i.e., to abort or not to abort, or, if the request has already beencompleted, to relate resource usage metrics, SQL text, etc. of aparticular query to its original source)

SUMMARY

In general, in one aspect, the invention features a method forrecovering from a failure of a soon-to-fail database system among aplurality of database systems in a multi-database system in processing arequest submitted to the multi-database system through a multi-databasesystem session. The method includes creating a query band for therequest, the query band being defined to be an identifier that uniquelyidentifies the session and the request among the plurality of sessionsand plurality of requests being processed by the multi-database systemat the time that the request was submitted. The method further includesattaching the query band to a transaction issued by the multi-databasesystem to the soon-to-fail database system to execute the query. Themethod further includes reporting the status concerning execution of thetransaction by the soon-to-fail database system. The status includes thequery band. The method further includes logging the status. The methodfurther includes detecting the failure of the soon-to-fail databasesystem. The method further includes reconstructing the state of thesoon-to-fail database system from the logged status as the state relatedto the processing of the transaction using the query band. The methodfurther includes using the reconstructed state to continue processing ofthe transaction by an alternative database system. The alternativedatabase system is one of the plurality of database systems in themulti-database system. The method further includes processing therequest to produce a result and storing the result.

Implementations of the invention may include one or more of thefollowing. The method may further include selecting the soon-to-faildatabase system to perform a transaction required to execute the query.The selection may be between the soon-to-fail database system and thealternative database system. The soon-to-fail database system and thealternative database system may have the access to data necessary toperform the transaction. Reporting the status concerning execution ofthe transaction by the soon-to-fail database system may includereporting the status to a logging subsystem. Creating the query band forthe request may include deriving an arbitrary string of characters froman identification of the session and an identification of the request.Deriving the arbitrary string of characters may include concatenatingthe identification of the session and the identification of the request.Deriving the arbitrary string of characters may include using a hashoperation. Deriving the arbitrary string of characters may include usingthe time the request was submitted.

In general, in another aspect, the invention features a database system.The system includes one or more nodes. The system further includes aplurality of CPUs, each of the one or more nodes providing access to oneor more CPUs. The system further includes a plurality of virtualprocesses, each of the one or more CPUs providing access to one or morevirtual processes. Each virtual process is configured to manage data,including rows from the set of database table rows, stored in one of aplurality of data-storage facilities. The system further includes aprocess for recovering from a failure of a soon-to-fail database systemamong a plurality of database systems in a multi-database system inprocessing a request submitted to the multi-database system through amulti-database system session. The process includes creating a queryband for the request, the query band being defined to be an identifierthat uniquely identifies the session and the request among the pluralityof sessions and plurality of requests being processed by themulti-database system at the time that the request was submitted. Theprocess further includes attaching the query band to a transactionissued by the multi-database system to the soon-to-fail database systemto execute the query. The process further includes reporting the statusconcerning execution of the transaction by the soon-to-fail databasesystem, the status including the query band. The process furtherincludes logging the status. The process further includes detecting thefailure of the soon-to-fail database system. The process furtherincludes reconstructing the state of the soon-to-fail database systemfrom the logged status as the state related to is the processing of thetransaction using the query band. The process further includes using thereconstructed state to continue processing of the transaction by analternative database system, the alternative database system being oneof the plurality of database systems in the multi-database system. Theprocess further includes processing the request to produce a result andstoring the result.

In general, in another aspect, the invention features a computerprogram, stored in a computer-readable tangible medium, for recoveringfrom a failure of a soon-to-fail database system among a plurality ofdatabase systems in a multi-database system in processing a requestsubmitted to the multi-database system through a multi-database systemsession. The program includes executable instructions that cause acomputer to create a query band for the request. The query band isdefined to be an identifier that uniquely identifies the session and therequest among the plurality of sessions and plurality of requests beingprocessed by the multi-database system at the time that the request wassubmitted. The program further includes executable instructions thatcause a computer to attach the query band to a transaction issued by themulti-database system to the soon-to-fail database system to execute thequery. The program further includes executable instructions that cause acomputer to report the status concerning execution of the transaction bythe soon-to-fail database system. The status includes the query band.The program further includes executable instructions that cause acomputer to log the status. The program further includes executableinstructions that cause a computer to detect the failure of thesoon-to-fail database system. The program further includes executableinstructions that cause a computer to reconstruct the state of thesoon-to-fail database system from the logged status as the state relatedto the processing of the transaction using the query band. The programfurther includes executable instructions that cause a computer to usethe reconstructed state to continue processing of the transaction by analternative database system, the alternative database system being oneof the plurality of database systems in the multi-database system. Theprogram further includes executable instructions that cause a computerto process the request to produce a result and store the result.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a node of a database system.

FIG. 2 is a block diagram of a parsing engine.

FIG. 3 is a block diagram of a parser.

FIGS. 4-8, 16 and 20-23 are block diagrams of a system for administeringthe workload of a database system using feedback.

FIGS. 9-14 are screen shots illustrating the selection of service levelagreement parameters.

FIG. 15 is a flow chart illustrating the flow of workload processing.

FIGS. 17-19 illustrate merging and splitting workload groups.

FIGS. 20-23 are flowcharts illustrating a guide for the creation ofworkload rules.

FIG. 24 illustrates workload rules.

FIG. 25 illustrates categories of workload rules.

FIG. 26 illustrates types of filtering attributes.

FIG. 27 illustrates a tree.

FIGS. 28-38 show administrator screen shots.

FIGS. 39-50 are administrator flow charts.

FIG. 51 is a regulator flow chart.

FIG. 52 shows the relationship between the system condition detector andadjustor and the subsystem condition detector and adjustors.

FIG. 53 illustrates how subsystem and system condition information flowsthrough the system to the system condition detector and adjuster.

FIG. 54 illustrates a session pool.

FIG. 55 illustrates a multi-tier architecture.

FIG. 56 is a block diagram of a multi-database system.

FIG. 57 illustrates a hierarchy of parsing engines.

FIG. 58 is a block diagram of a method for recovering from the failureof a system database in a multi-database system.

DETAILED DESCRIPTION

The technique for guiding the development of workload group definitionclassifications disclosed herein has particular application, but is notlimited, to large databases that might contain many millions or billionsof records managed by a database system (“DBMS”) 100, such as a TeradataActive Data Warehousing System available from NCR Corporation. FIG. 1shows a sample architecture for one node 105 ₁ of the DBMS 100. The DBMSnode 105 ₁ includes one or more processing modules 110 _(1 . . . N),connected by a network 115, that manage the storage and retrieval ofdata in data-storage facilities 120 _(1 . . . N). Each of the processingmodules 110 _(1 . . . N) may be one or more physical processors or eachmay be a virtual processor, with one or more virtual processors runningon one or more physical processors.

For the case in which one or more virtual processors are running on asingle physical processor, the single physical processor swaps betweenthe set of N virtual processors.

For the case in which N virtual processors are running on an M-processornode, the node's operating system schedules the N virtual processors torun on its set of M physical processors. If there are 4 virtualprocessors and 4 physical processors, then typically each virtualprocessor would run on its own physical processor. If there are 8virtual processors and 4 physical processors, the operating system wouldschedule the 8 virtual processors against the 4 physical processors, inwhich case swapping of the virtual processors would occur.

Each of the processing modules 110 _(1 . . . N) manages a portion of adatabase that is stored in a corresponding one of the data-storagefacilities 120 _(1 . . . N). Each of the data-storage facilities 120_(1 . . . N) includes one or more disk drives. The DBMS may includemultiple nodes 105 _(2 . . . O) in addition to the illustrated node 105₁, connected by extending the network 115.

The system stores data in one or more tables in the data-storagefacilities 120 _(1 . . . N). The rows 125 _(1 . . . Z) of the tables arestored across multiple data-storage facilities 120 _(1 . . . N) toensure that the system workload is distributed evenly across theprocessing modules 110 _(1 . . . N). A parsing engine 130 organizes thestorage of data and the distribution of table rows 125 _(1 . . . Z)among the processing modules 110 _(1 . . . N). The parsing engine 130also coordinates the retrieval of data from the data-storage facilities120 _(1 . . . N) in response to queries received from a user at amainframe 135 or a client computer 140. The DBMS 100 usually receivesqueries and commands to build tables in a standard format, such as SQL.

In one implementation, the rows 125 _(1 . . . Z) are distributed acrossthe data-storage facilities 120 _(1 . . . N) by the parsing engine 130in accordance with their primary index. The primary index defines thecolumns of the rows that are used for calculating a hash value. Thefunction that produces the hash value from the values in the columnsspecified by the primary index is called the hash function. Someportion, possibly the entirety, of the hash value is designated a “hashbucket”. The hash buckets are assigned to data-storage facilities 120_(1 . . . N) and associated processing modules 110 _(1 . . . N) by ahash bucket map. The characteristics of the columns chosen for theprimary index determine how evenly the rows are distributed.

In one example system, the parsing engine 130 is made up of threecomponents: a session control 200, a parser 205, and a dispatcher 210,as shown in FIG. 2. The session control 200 provides the logon andlogoff function. It accepts a request for authorization to access thedatabase, verifies it, and then either allows or disallows the access.

Once the session control 200 allows a session to begin, a user maysubmit a SQL request, which is routed to the parser 205. As illustratedin FIG. 3, the parser 205 interprets the SQL request (block 300), checksit for proper SQL syntax (block 305), evaluates it semantically (block310), and consults a data dictionary to ensure that all of the objectsspecified in the SQL request actually exist and that the user has theauthority to perform the request (block 315). Finally, the parser 205runs an optimizer (block 320), which generates the least expensive planto perform the request.

The new set of requirements arising from diverse workloads requires adifferent mechanism for managing the workload on a system. Specifically,it is desired to dynamically adjust resources (e.g. CPU, disk I/O, BYNET(which is NCR's term for the network 115), memory, sessions, etc.) inorder to achieve a set of per-workload response time goals for complex“multi-class” workloads. In this context, a “workload” is a set ofrequests, which may include queries or utilities, such as loads, thathave some common characteristics, such as application, source ofrequest, type of query, priority, response time goals, etc., and a“multi-class workload” is an environment with more than one workload.Automatically managing and adjusting database management system (DBMS)resources (tasks, queues, CPU, memory, memory cache, disk, network,etc.) in order to achieve a set of per-workload response time goals fora complex multi-class workload is challenging because of theinter-dependence between workloads that results from their competitionfor shared resources.

The DBMS described herein accepts performance goals for each workload asinputs, and dynamically adjusts its own performance knobs, such as byallocating DBMS resources and throttling back incoming work, using thegoals as a guide. In one example system, the performance knobs arecalled priority scheduler knobs. When the priority scheduler knobs areadjusted, weights assigned to resource partitions and allocation groupsare changed. Adjusting how these weights are assigned modifies the wayaccess to the CPU, disk and memory is allocated among requests. Givenperformance objectives for each workload and the fact that the workloadsmay interfere with each other's performance through competition forshared resources, the DBMS may find a performance knob setting thatachieves one workload's goal but makes it difficult to achieve anotherworkload's goal.

The performance goals for each workload will vary widely as well, andmay or may not be related to their resource demands. For example, twoworkloads that execute the same application and DBMS code could havediffering performance goals simply because they were submitted fromdifferent departments in an organization. Conversely, even though twoworkloads have similar performance objectives, they may have verydifferent resource demands.

One solution to the problem of automatically satisfying all workloadperformance goals is to use more than one mechanism to manage systemworkload. This is because each class can have different resourceconsumption patterns, which means the most effective knob forcontrolling performance may be different for each workload. Manuallymanaging the knobs for each workload becomes increasingly impractical asthe workloads become more complex. Even if the DBMS can determine whichknobs to adjust, it must still decide in which dimension and how fareach one should be turned. In other words, the DBMS must translate aperformance goal specification into a particular resource allocationthat will achieve that goal.

The DBMS described herein achieves response times that are within apercentage of the goals for mixed workloads consisting of shorttransactions (tactical), long-running complex join queries, batch loads,etc. The system manages each component of its workload by goalperformance objectives.

While the system attempts to achieve a “simultaneous solution” for allworkloads, it attempts to find a solution for every workloadindependently while avoiding solutions for one workload that prohibitssolutions for other workloads. Such an approach significantly simplifiesthe problem, finds solutions relatively quickly, and discovers areasonable simultaneous solution in a large number of cases. Inaddition, the system uses a set of heuristics to control a ‘closed-loop’feedback mechanism. In one example system, the heuristics are“tweakable” values integrated throughout each component of thearchitecture and the weights assigned to each of the resource partitionsand allocation groups for a particular performance knob setting.Further, the system provides insight into workload response times inorder to provide a much finer granularity of control over responsetimes.

In most cases, a system-wide performance objective will not, in general,satisfy a set of workload-specific goals by simply managing a set ofsystem resources on an individual query(ies) basis (i.e., sessions,requests). To automatically achieve a per-workload performance goal in adatabase or operating system environment, the system first establishessystem-wide performance objectives and then manages (or regulates) theentire platform by managing queries (or other processes) in workloads.

The system includes a “closed-loop” workload management architecturecapable of satisfying a set of workload-specific goals. In other words,the system is an automated goal-oriented workload management systemcapable of supporting complex workloads and capable of self-adjusting tovarious types of workloads. The system's operation has five majorphases: 1) assigning a set of incoming request characteristics toworkload groups, assigning the workload groups to priority classes, andassigning goals (called Service Level Goals or SLGs) to the workloadgroups; 2) monitoring the execution of the workload groups against theirgoals; 3) regulating (adjusting and managing) the workload flow andpriorities to achieve the SLGs; 4) recommending adjustments to workloaddefinitions (e.g. by splitting or merging workload definitions) in orderto better isolate the subset of the workload that requires differentworkload management than the remainder of the original workload, and 5)correlating the results of the workload and taking action to improveperformance. The performance improvement can be accomplished in severalways: 1) through performance tuning recommendations such as the creationor change in index definitions or other supplements to table data, or torecollect statistics, or other performance tuning actions, 2) throughcapacity planning recommendations, for example increasing system power,3) through utilization of results to enable optimizer adaptive feedback,and 4) through recommending adjustments to SLGs of one workload tobetter complement the SLGs of another workload that it might beimpacting. All recommendations can either be enacted automatically, orafter “consultation” with the database administrator (“DBA”). The systemincludes the following components (illustrated in FIG. 4):

-   -   1) Administrator (block 405): This component provides a GUI to        define workloads and their SLGs and other workload management        requirements. The administrator 405 accesses data in logs 407        associated with the system, including a query log, and receives        capacity planning and performance tuning inputs as discussed        above. The administrator 405 is a primary interface for the DBA.        The administrator also establishes workload rules 409, which are        accessed and used by other elements of the system.    -   2) Monitor (block 410): This component provides a top level        dashboard view and the ability to drill down to various details        of workload group performance such as aggregate execution time,        execution time by request, aggregate resource consumption,        resource consumption by request, etc. Such data is stored in the        query log and other logs 407 available to the monitor. The        monitor also includes processes that initiate the performance        improvement mechanisms listed above and processes that provide        long term trend reporting, which may include providing        performance improvement recommendations. Some of the monitor        functionality may be performed by the regulator, which is        described in the next paragraph. The Regulator monitors        workloads internally. It does this by using internal messages        sent from the AMPs to the dispatcher 210. The dispatcher 210        provides an internal status of every session and request running        on the system.    -   3) Regulator (block 415): This component dynamically adjusts        system settings and/or projects performance issues and either        alerts the database administrator (DBA) or user to take action,        for example, by communication through the monitor, which is        capable of providing alerts, or through the exception log,        providing a way for applications and their users to become aware        of, and take action on, regulator actions. Alternatively, the        regulator can automatically take action by deferring requests or        executing requests with the appropriate priority to yield the        best solution given requirements defined by the administrator        (block 405).

Administration of Workload Groups (Workload Management Administrator)

The workload management administrator (block 405), or “administrator,”is responsible for determining (i.e., recommending) the appropriateapplication settings based on SLGs. Such activities as setting weights,managing active work tasks and changes to any and all options will beautomatic and taken out of the hands of the DBA. The user will be maskedfrom all complexity involved in setting up the priority scheduler, andbe freed to address the business issues around it.

As shown in FIG. 5, the workload management administrator (block 405)allows the DBA to establish workload rules, including SLGs, which arestored in a storage facility 409, accessible to the other components ofthe system. The DBA has access to a query log 505, which stores thesteps (i.e. requests) performed by the DBMS in executing a request alongwith database statistics associated with the various steps, and anexception log/queue 510, which contains records of the system'sdeviations from the SLGs established by the administrator. With theseresources, the DBA can examine past performance and establish SLGs thatare reasonable in light of the available system resources. In addition,the system provides a guide for creation of workload rules 515 whichguides the DBA in establishing the workload rules 409. The guideaccesses the query log 505 and the exception log/queue 510 in providingits guidance to the DBA.

The administrator assists the DBA in:

-   -   a) Establishing rules for dividing requests into candidate        workload groups, and creating workload group definitions.        Requests with similar characteristics (users, application,        table, resource requirement, etc.) are assigned to the same        workload group. The system supports the possibility of having        more than one workload group with similar system response        requirements.    -   b) Refining the workload group definitions and defining SLGs for        each workload group. The system provides guidance to the DBA for        response time and/or arrival rate threshold setting by        summarizing response time and arrival rate history per workload        group definition versus resource utilization levels, which it        extracts from the query log (from data stored by the regulator,        as described below), allowing the DBA to know the current        response time and arrival rate patterns. The DBA can then        cross-compare those patterns to satisfaction levels or business        requirements, if known, to derive an appropriate response time        and arrival rate threshold setting, i.e., an appropriate SLG.        After the administrator specifies the SLGs, the system        automatically generates the appropriate resource allocation        settings, as described below. These SLG requirements are        distributed to the rest of the system as workload rules.    -   c) Optionally, establishing priority classes and assigning        workload groups to the classes. Workload groups with similar        performance requirements are assigned to the same class.    -   d) Providing proactive feedback (i.e.: Validation) to the DBA        regarding the workload groups and their SLG assignments prior to        execution to better assure that the current assignments can be        met, i.e., that the SLG assignments as defined and potentially        modified by the DBA represent realistic goals. The DBA has the        option to refine workload group definitions and SLG assignments        as a result of that feedback.

The guide for creation of workload rules 515, shown in more detail inFIG. 16, is initiated by a request for WD classification details,typically from the DBA. In response, the system provides one or more ofthe following sets of information, much of which is retrieved from thequery log 505 or the exception log 510 (block 1610):

-   -   a. A snapshot of system usage, aggregating the reported        information on, for example, accounts, applications, etc. Such        information typically is not grouped by WD or by WD        classification but can be used as the raw data to identify WD        classifications or to create WD classifications where they do        not yet exist or where additional WD classifications are        necessary. For example, if the snapshot is sorted by account, it        may become apparent to the DBA that some requests from a        particular account should be classified the same way. Similarly,        aggregating the reported information on applications may help        identify requests associated with a particular application that        should be assigned to the same WD classification. An example of        such an application might be point-of-sale applications that        should be assigned to a tactical WD classification giving them        priority and quick response times.    -   b. A mapping of existing WD-like definitions to WD        classifications. The system would provide this type of        information when WD classifications have not yet been defined or        where WDs have not yet been classified. The system would map        existing WD-like information and classification information to        existing or suggested WD classifications. The DBA can accept the        mapping, which would have the effect of creating the WD        classifications, or can adjust the assignments as necessary.    -   c. Existing WD classification information. The system provides        existing WD classification information where it has already been        defined. The DBA can decide to accept the existing WD        classification information or to modify it.

The DBA determines whether the provided WD classification information issatisfactory (block 1615). If it is, the system initiates the definitionof SLGs for the WDs (block 1620, described in more detail with respectto FIG. 22) and defines PSF settings, i.e. parameters that define theway system resources are dynamically assigned to requests, for WDs(block 1625, defined in more detail with respect to FIG. 23). Theprocess of guiding the creation of workload rules (block 515) is thencomplete (block 1630).

If, on the other hand, the DBA determines that the provided WDclassification information is not satisfactory (block 1615), the systemsplits and merges the WD classifications (block 1635). The basicapproach to splitting and merging WD classifications is illustrated inFIGS. 17-19. FIG. 17 shows system usage information over a period oftime sorted by WD classification, each WD classification correspondingto a section or “slice” of the pie. As can be seen, one WDclassification 1705 is consuming a large share of the system resourceswhile five other WD classifications 1710A, 1710B, 1710C, 1710D and 1710Eare consuming a much smaller share than the other WD classifications inthe system. The system may decide to split WD classification 705 and tomerge WD classifications 1710A, 710B, 710C, 710D and 710E. After themerge, as shown in FIG. 18, WD classifications 710A, 1710B, 1710C, 1710Dand 1710E have been merged into a single WD classification 1805. Afterthe split, as shown in FIG. 19, WD classification 1705 has been splitinto WD classifications 1905 and 1910.

The process for merging or splitting existing WD classifications,illustrated in FIG. 20, begins by merging or splitting the WDclassifications for accounting purposes (block 2005). This processaccommodates the DBA's possible interest in dividing or merging the WDclassifications by account. For example, the DBA may want to assign aparticular account to its own WD classification to identify its resourceconsumption and performance characteristics. Similarly, the DBA maydecide to combine WD classifications that are similar and do not requiresuch granular identification.

Once the WD classifications are merged or split for accounting reasons(block 2005), the system determines if the SLGs for the WDclassifications have been met (block 2010). It does this by aggregatinginformation from the query log 505 and the exception log 510 regardingthe performance of the requests that ran under each WD classificationand comparing the aggregated performance against the SLGs.Alternatively, the performance of each request under a WD classificationcould be compared to the SLGs and the statistics regarding the number ofrequests that satisfy the SLGs could be compiled and compared against athreshold.

If the SLGs are met, the process is complete (block 2015). If the SLGsare not met and the workload is heterogeneous suggesting that the SLGsof a subset of requests are met while others are not met, the systemconsiders splitting the workload into two or more workloads to enabledifferent workload management controls such that all SLGs can be met. Itcan do this by using information from the query log 505 and theexception log 510 to look for clusters of requests within the WDclassifications based on who, what, and where request information, suchas the source of request (“who”), the application (“what”), the type ofquery (“what”), the priority (“what”), the database object such astable, view or database (“where”), etc. (block 2020, described in moredetail with respect to FIG. 21). The system then splits the WDclassifications based on the chosen clusters (block 2025).

In one example, the system looks for clusters of requests within the WDsbased on who, what, and where request information, as shown in FIG. 21,by mapping request who, what and where information, which is retrievedfrom the query log 505 and the exception log 510, into an N-grid (block2105). A simple example 2-grid using request response time informationis provided below (the horizontal axis is for response time and thevertical axis is for requests):

Resp. time Request 0-10 10-20 20-30 30-40 40-50 50-60 60-70 70-80 (sec)14 x 13 x 12 x 11 x 10 x 9 x 8 x 7 x 6 x 5 x x 4 x 3 2 x 1 The systemfinds clusters of requests with the least in common with other groups ofrequests (block 2110). The simplistic case shown above suggests thefollowing clusters, based only on response time: a. Requests 5, 13 and14; b. Requests 10 and 12; c. Requests 4, 6 and 8.

This example could be extended into a third dimension by adding aconsideration of other who, what or where information associated witheach query. Similarly, the example could be extended to N dimensionswith the consideration of another N−1 types of information. Theidentification of clusters would proceed similarly.

Another example of information that might be used to identify clustersarises from an ability of the system to choose the “threshold orsummary” level logging option. If this option is selected, requests arelogged into either a summary query log or a detailed query log. Forexample, if the option is selected and the DBA specifies “Threshold=3”,then all requests that run in 3 seconds or more are logged to thedetailed query log. All requests that require less than 3 seconds to runare logged into the summary query log, which is essentially a count ofrequests tagged with “who” information. If the DBA specifies“Threshold>3 CPU or I/O” then the system would only log into thedetailed query log those requests that used at least 3 CPU seconds or 3I/Os. This information can readily be used to profile requests,applications, users, etc.

Still another example of information that might be used to identifyclusters arises from a “Summary” query logging option, which countsrequests into buckets. For example, if the DBA specifies “Summary 0 1020”, requests are summarized and counted into three buckets; 0-10,10-20, and 20-30. Again, this information can readily be used to profilerequests, applications, users, etc.

Preferably, rather than allowing the system to identify the clusters,the DBA defines the clusters based on an examination of the N-gridillustrated as shown above or by some other means (block 2115).

The process of defining SLGs for WDs (block 1620), shown in more detailin FIG. 22, begins with the system providing historical performanceinformation, such as throughput and response time, and defaults (e.g.,requests from a WD to meet SLGs 95 percent of the time, with a 25percent boost on performance), as a starting point (block 2205). Thehistorical information is retrieved, for example, from the query log 505and the exception log 510. The DBA can then define and refine the SLGswithin limits prescribed by the system (block 2210).

The process of defining PSF settings for WDs (block 1625), shown in moredetail in FIG. 23, begins with the system suggesting PSF settings,exception actions and delay rules based on SLGs (e.g. throughput,response time), SLG enforcement requirements based on the business valueof the workload and resource consumption requirements (block 2305). Theinformation used in making the suggestions is retrieved, for example,from the query log 505 and the exception log 510. The system then allowsthe DBA to adjust the PSF settings within limits prescribed by thesystem (block 2310).

Internal Monitoring and Regulation of Workload Groups (Regulator)

The internal monitoring and regulating component (regulator 415),illustrated in more detail in FIG. 6, accomplishes its objective bydynamically monitoring the workload characteristics (defined by theadministrator) using workload rules or other heuristics based on pastand current performance of the system that guide two feedbackmechanisms. It does this before the request begins execution and atperiodic intervals during query execution. Prior to query execution, anincoming request is examined to determine in which workload group itbelongs, based on criteria described below with respect to FIG. 11.Concurrency levels, i.e., the numbers of concurrent executing queriesfrom each workload group, are monitored, and if current workload groupconcurrency levels are above an administrator-defined threshold, arequest in that workload group waits in a queue prior to execution untilthe concurrency level subsides below the defined threshold. Queryexecution requests currently being executed are monitored to determineif they still meet the criteria of belonging in a particular workloadgroup by comparing request execution characteristics to a set ofexception conditions. If the result suggests that a request violates therules associated with a workload group, an action is taken to move therequest to another workload group or to abort it, and/or alert on or logthe situation with potential follow-up actions as a result of detectingthe situation. Current response times and throughput of each workloadgroup are also monitored dynamically to determine if they are meetingSLGs. A resource weight allocation for each performance group can beautomatically adjusted to better enable meeting SLGs using another setof heuristics described with respect to FIG. 6.

As shown in FIG. 6, the regulator 415 receives one or more requests,each of which is assigned by an assignment process (block 605) (thesystem may have more than one assignment process; for example, thesystem may have one assignment process per dispatcher) to a workloadgroup and, optionally, a priority class, and an enforcement priority(e.g. Tactical, Priority, Medium, Low, and Batch) in accordance with theworkload rules 409. The assigned requests are passed to a workload query(delay) manager 610, which is described in more detail with respect toFIG. 7. In general, the workload query (delay) manager monitors theworkload performance compared to the workload rules and either allowsthe request to be executed immediately or holds it for later execution,as described below. If the request is to be executed immediately, theworkload query (delay) manager 610 places the request in the priorityclass bucket 620 a . . . s corresponding to the priority class (i.e.,workload group) to which the request was assigned by the administrator405. A request processor under control of a priority scheduler facility(PSF) 625 selects queries from the priority class buckets 620 a . . . s,in an order determined by the enforcement priority associated with eachof the buckets, and executes it, as represented by the processing block630 on FIG. 6.

The request processor 625 also monitors the request processing andreports throughput information, for example, for each request and foreach workload group, to an exception monitoring process 615. Theexception monitoring process 615 compares the throughput with theworkload rules 409 and stores any exceptions (e.g., throughputdeviations from the workload rules) in the exception log/queue. Inaddition, the exception monitoring process 615 provides system resourceallocation adjustments to the request processor 625, which adjustssystem resource allocation accordingly, e.g., by adjusting the priorityscheduler weights. Further, the exception monitoring process 615provides data regarding the workgroup performance against workload rulesto the workload query (delay) manager 610, which uses the data todetermine whether to delay incoming requests, depending on the workloadgroup to which the request is assigned.

As can be seen in FIG. 6, the system provides two feedback loops,indicated by the circular arrows shown in the drawing. The firstfeedback loop includes the request processor 625 and the exceptionmonitoring process 615. In this first feedback loop, the system monitorson a short-term basis the execution of requests to detect deviationsgreater than a short-term threshold from the defined service level forthe workload group to which the requests were defined. If suchdeviations are detected, the DBMS is adjusted, e.g., by adjusting theassignment of system resources to workload groups. The second feedbackloop includes the workload query (delay) manager 610, the requestprocessor 625 and the exception monitoring process 615. In this secondfeedback loop, the system monitors on a long-term basis to detectdeviations from the expected level of service greater than a long-termthreshold. If it does, the system adjusts the execution of requests,e.g., by delaying, swapping out, throttling, or aborting requests, tobetter provide the expected level of service. Note that swapping outrequests is one form of memory control in the sense that before arequest is swapped out it consumes memory and after it is swapped out itdoes not. While this is the preferable form of memory control, otherforms, in which the amount of memory dedicated to an executing requestcan be adjusted as part of the feedback loop, are also possible.

The workload query (delay) manager 610, shown in greater detail in FIG.7, receives an assigned request as an input. A comparator 705 determinesif the request should be queued or released for execution. It does thisby determining the workload group assignment for the request andcomparing that workload group's performance against the workload rules,provided by the exception monitoring process 615. For example, thecomparator 705 may examine the concurrency level of requests beingexecuted under the workload group to which the request is assigned.Further, the comparator may compare the workload group's performanceagainst other workload rules.

If the comparator 705 determines that the request should not beexecuted, it places the request in a queue 710 along with any otherrequests for which execution has been delayed. Queue 710 may represent aset of queues. In some example systems, the set of queues 710 includesone queue for each workload group. Thus, when a request is placed in thequeue 710 it is placed in the queue associated with the appropriateworkload group. For example, if a Tactical workload group has aconcurrency limit defined then all Tactical queries would be placed onthe Tactical delay queue when the limit is reached. Subsequently, if aLong Running Queries workload group has a concurrency limit then theLong Running Queries would be queued on the “Long Running Query” queue,and so on. The comparator 705 continues to monitor the workload group'sperformance against the workload rules and when it reaches an acceptablelevel, it extracts the request from the appropriate queue of the set ofqueues 710 (i.e., the queue associated with the workload group) andreleases the request for execution. In some cases, it is not necessaryfor the request to be stored in the queue to wait for workgroupperformance to reach a particular level, in which case it is releasedimmediately for execution.

Once a request is released for execution it is dispatched (block 715) topriority class buckets 620 a . . . s, where it will await retrieval bythe request processor 625. For example, in the case of SMP/MPP systems,this may be an All-AMP or single-AMP broadcast message to all AMPs or asingle AMP in the system.

The exception monitoring process 615, illustrated in greater detail inFIG. 8, receives throughput information from the request processor 625.A workload performance to workload rules comparator 805 compares thereceived throughput information to the workload rules and logs anydeviations that it finds in the exception log/queue 510. It alsogenerates the workload performance against workload rules informationthat is provided to the workload query (delay) manager 610.

To determine what adjustments to the system resources are necessary, theexception monitoring process calculates a ‘performance goal index’ (PGI)for each workload group (block 810), where PGI is defined as theobserved average response time (derived from the throughput information)divided by the response time goal (derived from the workload rules).Because it is normalized relative to the goal, the PGI is a usefulindicator of performance that allows comparisons across workload groups.

The exception monitoring process adjusts the allocation of systemresources among the workload groups (block 815) using one of twoalternative methods. Method 1 is to minimize the maximum PGI for allworkload groups for which defined goals exist. Method 2 is to minimizethe maximum PGI for the highest priority workload groups first,potentially at the expense of the lower priority workload groups, beforeminimizing the maximum PGI for the lower priority workload groups.Method 1 or 2 are specified by the DBA in advance through theadministrator.

The system resource allocation adjustment is transmitted to the requestprocessor 625 (discussed above). By seeking to minimize the maximum PGIfor all workload groups, the system treats the overall workload of thesystem rather than simply attempting to improve performance for a singleworkload. In most cases, the system will reject a solution that reducesthe PGI for one workload group while rendering the PGI for anotherworkload group unacceptable.

This approach means that the system does not have to maintain specificresponse times very accurately. Rather, it only needs to determine thecorrect relative or average response times when comparing betweendifferent workload groups.

In summary the regulator:

-   -   a) Regulates (adjusts) system resources against workload        expectations (SLGs) and projects when response times will exceed        those SLG performance thresholds so that action can be taken to        prevent the problem.    -   b) Uses cost thresholds, which include CPU time, IO count, disk        to CPU ratio (calculated from the previous two items), CPU or IO        skew (cost as compared to highest node usage vs. average node        usage), spool usage, response time and blocked time, to “adjust”        or regulate against response time requirements by workload SLGs.        The last two items in the list are impacted by system        conditions, while the other items are all query-specific costs.        The regulator will use the PSF to handle dynamic adjustments to        the allocation of resources to meet SLGs.    -   c) Defers the query(ies) so as to avoid missing service level        goals on a currently executing workload. Optionally, the user is        allowed to execute the query(ies) and have all workloads miss        SLGs by a proportional percentage based on shortage of resources        (i.e., based on administrators input), as discussed above with        respect to the two methods for adjusting the allocation of        system resources.

Monitoring System Performance (Monitor)

The monitor 410 (FIG. 4) provides a hierarchical view of workload groupsas they relate to SLGs. It provides filtering options on those viewssuch as to view only active sessions versus all sessions, to view onlysessions of certain workload groups, etc.

The monitor:

-   -   a) Provides monitoring views by workload group(s). For example,        the monitor displays the status of workload groups versus        milestones, etc.    -   b) Provides feedback and diagnostics if expected performance is        not delivered. When expected consistent response time is not        achieved, explanatory information is provided to the        administrator along with direction as to what the administrator        can do to return to consistency.    -   d) Identifies out of variance conditions. Using historical logs        as compared to current/real-time query response times, CPU        usage, etc., the monitor identifies queries that are out of        variance for, e.g., a given user/account/application IDs. The        monitor provides an option for automatic screen refresh at        DBA-defined intervals (say, every minute.)    -   e) Provides the ability to watch the progress of a session/query        while it is executing.    -   f) Provides analysis to identify workloads with the heaviest        usage. Identifies the heaviest hitting workload groups or users        either by querying the Query Log or other logs. With the        heaviest usage identified, developers and DBAs can prioritize        their tuning efforts appropriately.    -   g) Cross-compares workload response time histories (via Query        Log) with workload SLGs to determine if query gating through        altered TDQM settings presents feasible opportunities for the        workload.

The graphical user interface for the creation of Workload Definitionsand their SLGs, shown in FIG. 9, includes a Workload Group Name column,which can be filled in by the DBA. Each row of the display shown in FIG.9 corresponds to a different workload group. The example screen in FIG.9 shows the “Inventory Tactical” workload group, the “CRM Tactical”workload group and others. For each workload group, the DBA can assign aset of service level goals. In the example shown in FIG. 9, the servicelevel goals include the “desired response & service level” and“enforcement policy.” The desired response & service level for theInventory Tactical workload group is “<=1 sec @ 95%”, which means thatthe DBA has specified that the Inventory Tactical workload group goal isto execute within 1 second 95 percent of the time. The enforcementpriority for the Inventory Tactical workload group is “Tactical”, whichgives this workload group the highest priority in achieving its desiredresponse & service level goals. A lower priority, “Priority”, isassigned to the Sales Short Qry workload group. As can be seen in FIG.9, multiple workload groups can be assigned the same enforcementpriority assignments. That is, the Sales Cont Loads, Inventory Tactical,CRM Tactical and Call Ctr Tactical workload groups all have “Tactical”as their enforcement priority.

Each workload group also has an “operating window,” which refers to theperiod of time during which the service level goals displayed for thatworkload group are enforced. For example, the Inventory Tacticaloperating group has the service level goals displayed on FIG. 9 from 8AM-6 PM. The service level goals can be changed from one operatingwindow to another, as indicated below in the discussion of FIG. 10.

Each workload group is also assigned an arrival rate, which indicatesthe anticipated arrival rate of this workload. This is used forcomputing initial assignment of resource allocation weights, which canbe altered dynamically as arrival rate patterns vary over time.

Each workload group is also assigned an “initiation instruction,” whichindicates how processes from this workload group are to be executed. Aninitiation instruction can be (a) “Expedite,” which means that requestsfrom this workload group can utilize reserved resources, known asReserved Amp Worker Tasks, rather than waiting in queue for regular AmpWorker Tasks to become available, (b) “Exec,” which means the request isexecuted normally, i.e.: without expedite privileges, or (c) “Delay,”which means the request must abide by concurrency threshold controls,limiting the number of concurrent executing queries from this workloadgroup to some specified amount. Initiation instructions are discussed inmore detail with respect to FIG. 13.

Each workload group is also assigned an “exception processing”parameter, which defines the process that is to be executed if anexception occurs with respect to that workload group. For example, theexception processing for the Inventory Tactical workload group is tochange the workload group of the executing query to Inventory LongQry,adopting all the characteristics of that workload group. Exceptionprocessing is discussed in more detail with respect to FIGS. 14-15.

Some of these parameters (i.e.: enforcement priority, arrival rate,initiation instructions, and exception processing) can be givendifferent values over different operating windows of time during theday, as shown in FIG. 10. In the example shown in FIG. 10, threeoperating windows are defined: (a) 8 AM-6 PM (which corresponds to theoperating window depicted in FIG. 9); (b) 6 PM-12 AM; and (c) 12 AM-8AM.

Each of the highlighted zones in shown in FIG. 9 or 10 (i.e., theworkload definition name, the initiation instructions and the exceptionprocessing definition) indicate buttons on the screen that can beactivated to allow further definition of that parameter. For example,pressing the “Inv Tactical” button on FIG. 10 causes the screen shown inFIG. 11, which is the classification criteria for the Inventory Tacticalworkgroup, to be displayed. Through this screen, the DBA can define therequest sources (who), the tables/views/databases that can be accessed(where) and/or the request resource usage predictions that can executeprocesses in the Inventory Tactical workgroup. The keywords shown in thehighlighted boxes of FIG. 11 (who classification: User ID, Account ID,Profile, Appl Executable ID, Query Band ID, Client User ID, ClientSource or Address; what classification: to Estimated Time, EstimatedRows, AMPs involved, Join Type, Scan Type; where classification: TableAccessed, Database Accessed, View Accessed) can be used to formulate thequery classification. In the example shown in FIG. 11, the “who” portionof the classification definition is:

All Users with Account “TacticalQrys”

and User not in (andyjohnjane)

and querybandID=“These are really tactical”

In the example shown in FIG. 11, the “what” portion of theclassification has been defined as:

Estimated time<100 ms AND

<=10 AMPs involved

Note that the “estimated time” line of the “what” portion of theclassification could be rephrased in seconds as “Estimated time<0.1seconds AND”.

In the example shown in FIG. 11, the “where” portion of theclassification has been defined as:

Table Accessed=DailySales

If one of the buttons shown under the exception processing column inFIGS. 9 and 10 is pressed, the screen shown in FIG. 12 appears, allowingspecification of the exception conditions and processing for theselected workload group. The keywords shown in the highlighted box inthe Exception Thresholds zone of the screen shown in FIG. 11 (SpoolUsage, Actual Rows, Actual CPU Time, Actual IO Counts, CPU or IO Skew,Disk to CPU Ratio, Response Time and Blocked Time) can be used toformulate the Exceptions Thresholds criteria. If an exception occurs,and if the DBA desires the system to potentially continue the requestunder a different workload group, that workload group is defined here.In a sense, an exception indicates that the request is displaying querycharacteristics that are not in keeping with the norm for this workloadgroup, so it must instead belong in the alternative workload groupdesignated on the screen shown in FIG. 12. There are two exceptionconditions where this assessment could be in error: Response Time andBlocked Time. Both Response Time and Blocked Time can cause requestperformance to vary because of system conditions rather than thecharacteristics of the query itself. If these exception criteria aredefined, in one example the system does not allow an alternativeworkload group to be defined. In one example system, some conditionsneed to be present for some duration before the system takes action onthem. For example; a momentary skew or high disk to CPU ratio is notnecessarily a problem, but if it continues for some longer period oftime, it would qualify as a problem that requires exception processing.In the example shown in FIG. 12, the Exceptions Thresholds have beendefined as:

CPU Time (i.e., CPU usage)>500 ms and

(Disk to CPU Ratio>50) or (CPU Skew>40%)) for at least 120 seconds

Clicking on one of the buttons under the “initiation instruction” columnin the display shown in FIGS. 9 and 10 causes the execution initiationinstructions screen, shown in FIG. 13, to be displayed. For example,through the display shown in FIG. 13, the Execution InitiationInstructions for the Inventory Tactical workgroup for the operatingwindow from 8 AM-6 PM can be displayed and modified. In the exampleshown in FIG. 13, the three options for Execution Initiation Instructionare “Execute (normal),” “Expedite Execution,” and “Delay Until”, withthe last selection having another button, which, when pressed, allowsthe DBA to specify the delay conditions. In the example shown in FIG.13, the Expedite Execution instruction has been selected, as indicatedby the filled-in bullet next to that selection.

Returning to FIG. 10, the details of the Exception Processing parametercan be specified by selecting one of the highlighted buttons under theException Processing heading. For example, if the button for the 8 AM-6PM operating window is pressed, the screen shown in FIG. 14 isdisplayed. The screen shown in FIG. 14 provides the following exceptionprocessing selections: (a) “Abort Request”; (b) “Continue/log condition(Warning Mode)”; and (c) “Continue/Change Workload Group to” theworkload group allowed when the exception criteria were described in thescreen shown in FIG. 12; and (d) “Continue/Send Alert to [pulldown menufor possible recipients for alerts].” If selection (a) is chosen, theassociated request is aborted if an exception occurs. If selection (b)is chosen, an exception is logged in the exception log/queue 510 if oneoccurs. If selection (c) is chosen, and it is in the example shown inFIG. 14, as indicated by the darkened bullet, the request isautomatically continued, but in the different work group pre-designatedin FIG. 12. If selection (d) is chosen, processing of the requestcontinues and an alert is sent to a destination chosen using thepulldown menu shown. In the example shown in FIG. 14, the chosendestination is the DBA.

The flow of request processing is illustrated in FIG. 15. A new requestis classified by the workload classification block 1505 in which it iseither rejected, and not executed, or accepted, and executed. As shownin FIG. 15, the execution delay set up using the screen illustrated inFIG. 13 occurs prior to execution under the control of PSF. Theexecution is monitored (block 1510) and based on the exceptionprocessing selected through the screen illustrated in FIG. 14, therequest is aborted, continued with an alert being sent, continued withthe exception being logged, or continued with the request being changedto a different workload, with perhaps different service level goals.

A further description of the administrator, as part of the larger systemillustrated in FIG. 4, which will be referred to as Teradata DynamicWorkload Management, or TDWM, will now be provided. The workload rules409 (see FIG. 5) include rules 2405 and workload definitions 2410. Therules 2405 include object-based filtering rules 2415 and object-basedthrottling rules 2420. The workload definitions 2410 include workloaddefinitions 2425, workload classification attributes 2430, workloadthrottling attributes 2435, workload exception attributes 2440, andconfigurations 2445. The configurations define the unique configurationids that are used by all table entries.

Object-based filtering rules 2415 are applied when a request issubmitted to the database system before the request is executed. Thedatabase system either accepts the request for processing or rejects therequest. In one example system, these rules match the existing filteringrules, which may be (a) who submitted, (b) what table accessed, (c)estimated processing, etc. Further, these rules may include an abilityto filter on the type of statement, such as SELECT, INSERT, DELETE, etc.These rules are applied before a request is classified into a workload.An example of such a rule is:

-   -   Reject all non-SELECT requests that access the INVENTORY_HISTORY        table.

The object-based throttling rules 2420 are applied when a request issubmitted to the database management system before a request isexecuted. In one example system, object-based throttling rules 2420 areexisting rules.

The object-based throttling rules 2420 may use object information (whosubmitted, what table accessed, etc.) to determine if the request shouldbe executed immediately or put on a delay queue (e.g. queue 710, FIG.7). For each throttling rule, the database administrator may define howmany requests that match the rule may be running at one time. When thethreshold is exceeded, new requests may be placed on the delay queue.Requests may be removed from the delay queue when one of the runningrequests completes. Load utilities also have throttling rules. Anexample of such an object-based throttling rule is:

-   -   No more than 10 requests from user A may run at one time.

Workload definitions 2425 are as described above.

Workload classification attributes 2430 may be applied when a request issubmitted to the database management system. They determine the workloaddefinition to which each request belongs. Requests may be classifiedusing nearly any combination of many factors (who submits, whatapplication, what objects are accessed, estimated processing time,etc.). AND, OR, and NOT conditions may be created by combining severalclassification rules for a single workload definition. An example of aworkload classification attribute is:

-   -   The CRM_TACTICAL workload is composed of requests submitted by        the CRM application that have an estimated CPU time of less than        two seconds.

Workload throttling attributes 2435 may be applied after the request hasbeen classified but before it is executed. Each workload may have a setof initiation attributes that apply to its requests that determine ifrequests are rejected, throttled, or run with special privileges. Anexample of the workload throttling attribute is:

-   -   No more than 15 requests in the CRM_ANALYTICS workload may be        run at one time.

Workload exception attributes 2420 may be applied while a request isrunning. Each workload may have a set of exception rules that apply toits requests. The database management system may monitor the requestsfor the exception conditions (actual CPU time, actual I/O, actualresponse time, actual skew). The database administrator may determinethe threshold for each exception condition. A workload definition mayhave different exception actions in different periods. An example of aworkload exception attribute is:

-   -   If a request in the CRM_TACTICAL workload uses more than five        CPU seconds, move it to the CRM_ANALYTICS workload.

These rules and definitions fall into three categories, as illustratedin FIG. 25. Category 1 includes the object-based filtering rules.Category 2 includes the object-based throttling rules. Category 3includes all of the workload definitions, including workloaddefinitions, workload classification attributes, workload throttlingattributes, and workload exception attributes. The to databaseadministrator may enable or disable-any (or all) level of workloadmanagement. Most object-based rules are valid whether workloadmanagement is enabled or not. Throttling based on request performancegroup is ignored when workload management is enabled. “Performancegroup” is a priority scheduler term used to indicate the mapping ofworkload definitions to an operating schedule or class of work.

Object-Based Filtering

The database administrator creates the access and object rules forfiltering out requests before they are accepted by the databasemanagement system. Filtering rule creation may be a capability that isseparate from the actual filtering.

If filtering is enabled (that is, if category 1 is enabled) each requestis checked against object access and request resource filter rules,created using the filtering rule creation capability and maintained bythe database management system.

Specific “who” objects can be set up to circumvent or bypass category 1checking (for example, to bypass category 1 checking for specific typesof users). If there is a rule against running a particular request, therequest is rejected.

Rejection errors are reported back to the user and they are logged inthe query log 505.

The different filtering attributes are illustrated in FIG. 26. The“when” filtering attributes include date and time. The “who” filteringattributes include User ID, Account ID, Application ID, Query Band,Client ID, Client Address, and Profile. The “what” filtering attributesinclude Estimated processing time, Estimated answer set, Type ofstatement, and Join, full data scan conditions. The “where” attributesinclude database, table, view, etc.

Object-Based Throttling

Session and/or request throttling can be created on various levels,including users, accounts, and performance group objects. In someexample systems, performance group limits are ignored when category 3 isenabled. When category 3 is enabled, object-based throttling is replacedby having limits on requests within a workload definition.

Throttling values (i.e., limits on sessions and/or requests) can beplaced on a user, an account, a performance group and combinations ofuser and performance group or account and performance group.

In some example systems, throttling values can also be placed on aprofile and on each individual load utility. Further, under category 2,the system can override the database system MaxLoadTasks value, which isa value that represents the number of load utilities that can run inparallel. In one example system, the default value of MaxLoadTasks is15. The default value can be changed through a throttling value rule.Some systems have a load utility limit, which cannot be exceeded.

In some example systems, object-based throttling rules also handle thesame “who” and “where” objects as the rules in effect when the system isoperating in category 1. In some example systems, object throttlingrules are also circumvented by bypassed objects. In some examplesystems, the only object that can be bypassed is USER.

In some example systems, a throttle limit for requests may be placed onaccess objects such as user or performance group. The purpose of such athrottle limit is to limit the number of high-impact requests caused bya request that accesses all processing modules 110 _(1 . . . N), whichis sometimes called an all-AMP request, where AMP is an abbreviation forAccess Module Processor. With the advent of workload definitions, allrequests, not just all-AMP requests, are subject to throttles. Thismeans that there are two distinct meanings to throttle limits dependingon whether access objects or workload definitions are being throttled.The administrator may indicate whether all requests or only all-AMPrequests should be used in the counting of active requests against thethrottle limit. Accounting for all requests may require substantialoverhead processing. Consequently, this option is expected to be used inspecific instances, such as a specific user that must be completelystopped from issuing requests. Limits on load utilities are the numberof instances of utilities, not requests as in workload definitions(category 3).

The database administrator characterizes workload behavior throughworkload definitions. The database management system may assign arequest to a workload definition based on the request attributes and theworkload definitions.

Workload definition criteria may include classification, exceptioncriteria and actions, period specification, service level goals andenforcement priority. Enforcement priority indicates the degree ofimportance of the workload definition. Workload definitions can havedifferent to characteristics during different time periods as systemworkload levels and response times change throughout the day or week ormonth.

Each workload definition is assigned to a performance group by thedatabase management system. The workload definition will run in itsassigned performance group under the PSF 625. The administrator maygenerate default workload definitions, used for requests that are notclassified into any other workload definition or for those requests thatdo not have optimizer costs generated for them.

The administrator may also assign a number to the workload definition.In one example system, the workload definition numbers are not reused asnew rules are made. History log entries, which contain a workloaddefinition number, can always be tracked back to a workload definition.

The workload definition needs for the TDWM are generated by the databaseadministrator using data collected via the profiler 515 and other datasources.

In some example systems, the administrator provides a tree view on theleft side of a display screen, such as that shown in FIG. 27. The treeview shows a top level node for category 1 and 2 rules. It may alsoinclude a node for each category 1 and category 2 rule. The treestructure also includes top level nodes for workload administration andpriority scheduler. When the administrator starts, it reads the TDWMdatabase and populates the tree view.

When the user selects a “terminal” node, such as “Period 1” (which hasno nodes with greater levels of indention immediately beneath it), aview of the data defined for that node will appear on the right side ofthe screen.

For each item in the tree view, it will be possible to invoke a rightclick pop-up menu with choices appropriate to the item, including:

Display a New Window;

New Item Duplicate;

New Item Delete; and

New Item, etc.

When the user selects a terminal tree node and changes the contents ofthe node, two buttons will be enabled: “OK” and “Cancel.” If the userselects another tree node before either button is clicked, a warningmessage will be displayed to chose one of the displayed options. Whenthe user selects “periods” or “workload definitions” on the tree, a listview (or spreadsheet) with a row for each item on the tree beneath theselected period or workload definition may be provided to present asummary of the periods or workload definitions. In some systems, thelist view will be read only. If the user clicks on a row in the listview, the corresponding item is selected in the tree and the right viewis changed to provide information for that item.

In some example systems, the period overview will have a grid with acolumn for the period name and a column containing a brief textualdescription of the definition. When the user clicks on a row in thegrid, it will have the same effect as clicking on that period in thetree. That is, it will display the period property sheet on the righthand side of the screen.

When the user clicks “workload definitions” in the tree, the right handside of the screen will display a list of defined workloads along withservice level goals, arrival rate, initiation instruction and exceptionprocessing. In some example systems, the list will be sortable on thefirst column. In other example systems, the table will be sortable onall columns.

Some example systems will provide a drop-down list of defined periods.When the user selects a period, the administrator will fill the listwith the data for that period. When the user selects a row and clicks inthe first column (e.g. workload definition name), the administrator willdisplay that workload and the classification tab.

When the user selects a row and clicks in any column other than thefirst column, the administrator will display that workload displayingthe workload period tab with the current period in the summary selected.When workload definitions are selected in the tree, and a commandappears on the right-click menu, those commands will have buttons,including Add, Delete and Split.

When the administrator starts up, it verifies the TDWM tables have beencreated and initialized. If they have not, the user is prompted tocreate the tables. If the user has proper permissions, the tables arecreated. If not, the user is referred to the system administrator. Oncethe TDWM tables have been created and initialized, the administratorreads and validates the TDWM configuration and TDWM PSF template (i.e.tables in the database TDWM that contain PSF configuration information)on the database management system.

The administrator then determines if TDWM category 3 has been enabled onthe database management system. If not, the user may still use theadministrator to define workload definitions or to retrieve a set ofworkload definitions from a file.

The system provides default workload definitions. One example systemincludes five default workload definitions. Each of the four standardperformance groups (R, H, M and L) will have a workload definition. R,H, M and L are abbreviations for Rush, High, Medium and Low,respectively. In one example system, each of these standard workloaddefinitions is available by default. A fifth default, called, “NoHome.”

A procedure outside the administrator may process current schmonsettings, which are settings associated with the schmon utility thatmonitors operating system task and thread usage on the system, and otherparameters and create an initial workload definition configuration. Theinitial workload definition configuration will be a set of entries inthe TDWM tables.

When the administrator starts for the first time, it may load thisconfiguration so that the user has a starting point for definingworkload definitions.

The administrator may provide two entries on its main menu for workloadand priority schedule order. These entries will be enabled only when theworkload definition feature is present on the user's system. Theworkload entry will have menu items for:

New Period;

New Workload;

New Classification;

New Exclusion;

New Workload Period;

Get Current Period;

Enable/Disable;

Compare Weights;

Show;

Show All;

Etc.

Each menu selection may only be enabled when an appropriate node isselected in the left panel tree.

The priority scheduler entry may have the following menu items:

Resource Partitions;

Allocation Groups;

Allocation Group Periods;

Workload Mapping;

Etc.

For each of the items in the workload and priority scheduler menus, whenthe user selects the item, a dialog screen may be displayed in the rightpanel. Each of the CFormView derivatives may have edit boxes and othercontrols for the user to enter appropriate values. Wherever possible,the administrator may provide the user all accessible choices for avalue and may validate all data before accepting it.

The Get Current Period command may cause the database management systemto retrieve the period then in effect. The database administrator canthen look at the specifications for that period to investigate systemoperation.

The Enable/Disable dialog may list the TDWM configurations that havebeen saved in the TDWM tables, as shown in FIG. 28. The user can selecta configuration and enable it by selecting the enable button andclicking OK, which will cause the configuration to be loaded into theadministrator. Selecting disable and clicking OK may disable theworkload classification (assuming category 3 is enabled). Selecting aconfiguration, selecting the load button and clicking OK may load theTDWM configuration into the TDWM administrator without affecting thecurrent state of TDWM on the database management system.

The Compare Weights command may cause the system to numericallycalculate the relative weights and provide a graphical representation ofthe weights. The relative weights of resource partitions (RPs) are shownby column width and relative weight of allocation groups by columnsegment height. “Resource partition” is a priority scheduler term usedto describe the division of operating system resources. “Allocationgroup” is another priority scheduler term that describes the mapping ofpriority scheduler information to performance groups.

The Show command may display, in a separate pop-up window, a textualdescription of the node selected, depending on the level of the nodeselected in the tree. The window may have Save (to file) and Printbuttons.

When the user clicks on Workload Administration in the tree (FIG. 27), aparameter dialog may display all of the global parameters for TDWM.Global parameters are those that pertain to the TDWM function and not toany specific workload definition. Global parameters include:

Workload Management Enabled/Disabled (true or false);

Workload Exception Interval;

Summary Log Interval; and

Log Flush Interval.

Periods are global elements that can be used by any workload definition.A period may be displayed as a multi-tab view property sheet, as shownin FIG. 29. Such a period property sheet includes tabs for date/time,resource partitions, and allocation groups.

The date/time tab allows behaviors to be specified for the workloaddefinition for different times of the day, which are specified by the“from” time field, the “to” time field and the applicable days andmonths fields. In some example systems, a default period is defined, inwhich the “every day” box is selected and the 24 hours box is selected.This period may be used when no other period is applicable. Adescription field for a defined period may appear in the tree view. Theresource partitions view, illustrated in FIG. 30, will include a grid,which will have a row for RP name, a row for RP assigned weight, and arow for RP relative weight. Only RPs with a non-zero weight will bedefined. The user defines an RP by giving it a weight and drops it bysetting the weight to zero. When the RP becomes active, the name is setto the RP ID (for RPs other than RP0). Only RPs that the user hasdefined (weight greater than zero) can be edited. RP names, weight orrelative weight can be edited. When one of weight or relative weight isedited, the other value is also changed. RP names are the same acrossall periods.

The user may define parameters for the default periods first. Then anyblank fields in other periods will be filled in with values from thedefault period. The user may then change values as needed.

The allocation group tab, illustrated in FIG. 31, includes a grid whichhas columns for allocation group name, weight, reserved AMP Worker Tasks(“AWT”), which is a database term equivalent to the Unix terms “thread”or “process,” and enforcement priority. The user may define parametersfor the default period first. In some example systems, for every otherperiod, the values will be filled in with values from the defaultperiod. The user may then change values as needed. The enforcementpriority field is set by the administrator using the enforcementpriority of the first workload definition that uses the allocationgroup.

A workload definition multi-tab property sheet is illustrated in FIG.32. The workload definition property sheet provides tabs for workloadattributes, exception criteria, classification, workload period, andsummary. Since there can be multiple classifications and multipleperiods/actions defined, these tabs allow the user to choose whichclassification or period/action the user wishes to view from the listbox. One of the list box choices will be “new” to create a newclassification or period/action.

An example workload attributes tab, shown in FIG. 32, has the followingcontrols:

-   -   A text box (“Name”) for workload name (for example, 30        characters of text);    -   A text box (“Description”) for description of workload (for        example, 80 characters of text);    -   The following radio buttons for selecting logging mode        -   None.        -   Summary—if this radio button is pressed, the logging is            indexed by workload definition and reports the average            response time, CPU time, I/O time, the number of delayed            requests, etc. per workload definition. This is the default            value.        -   Full—if this radio button is selected, the log will contain            identification information for each request, the optimizer            values used for making decisions, what workload definition            the request was placed in, and the resulting runtime values.    -   Radio buttons for selecting an enforcement priority (tactical,        priority, normal or background);    -   An “Enabled” check box;    -   A drop-down list (“Next Workload”) for choosing the Next        Workload definition for exception action;    -   “Accept” and “Restore” buttons. The Accept button causes any        revisions to be accepted. The Restore button causes default        settings to be restored.

In some example systems, the Next Workload value shown on the workloadattributes tab is used in the workload period view. This value may beused in the New Workload field when the action is Change Workload. Insome example systems, the number of workload definitions is limited, forexample, to 35.

An exception criteria tab, shown in FIG. 33, allows definition ofexceptions, which occur when a running request exceeds a limit. An“Accept” button allows revisions to be accepted and a “Restore” buttonrestores defaults. In some example systems, for some of these values,such as skew and disk CPU ratio, the limit must be exceeded for a“qualification time” for an exception to occur. Further, in some examplesystems, all items with a non-zero value must occur for an exception tobe raised. In other words, the items with a non-zero value are ANDedtogether to determine if an exception should be raised. In other examplesystems, such as that shown in FIG. 33, the items with filled-in checkboxes will be ANDed together to determine if an exception should beraised. If the qualification time is zero, any of the conditions in thebox are satisfied as soon as they occur. If the qualification time isnon-zero, the exception occurs only if the exception condition persistsat least for the duration specified by the qualification time. Theexception criteria tab has text boxes that accept a value for each ofthe following:

MaxRows (“Maximum Rows”;

IOCount (“IO Count”);

BlockedTime (“Blocked Time”);

ResponseTime (“Elapsed Time”);

SpoolUsage (“Spool Size”);

NumberOfAMPS (“Number of Amps”);

CpuTime (“CPU Time”);

CpuSkewValue (“CPU Skew”);

CpuSkewPercent (“CPU Skew Percent”);

IOSkewValue (“IO Skew”);

IOSkewPercent (“IO Skew Percent”);

DiskCpuRatio (“Disk CPU Ratio”); and

QualifyTime (“Qualification Time”).

In some example systems, either blocked time (BlockedTime) or elapsedtime (ResponseTime), or both, are selected as conditions, changeworkload definition is not an allowed exception action. On the periodstab (discussed below with respect to FIG. 36) where exception action isspecified, change workload definition will be disabled if there isanything in those two condition fields.

If blocked time and/or elapsed time have values, the user will benotified that change workload definition is not available.

The example workload classification tab, illustrated in FIG. 34, has thefollowing controls:

-   -   Text boxes and check boxes for minimum and maximum rows;    -   Text boxes and check boxes for minimum and maximum final rows;    -   Text boxes and check boxes for minimum and maximum time;    -   Radio buttons for AMP limits: none, some, all;    -   Radio buttons for statement types (Select, DDL, DML, and All).        In some example systems, statement type and row, time and amp        limits are mutually exclusive;    -   Tabs for Account, Application, User, Client Id, Profile, Role,        Query Band, Client Address (i.e. IP address), and Database        Objects (i.e. databases, tables, views, and macros). The Client        Id tab, which is shown in FIG. 34, is illustrative of all of the        other tabs. It contains a “Classify by Client Id” checkbox,        which, if checked, means that Client Id will be a basis for        classification. It includes an “Available” box, which lists the        Clients that are available for selection, and a “Selected” box,        which lists the clients that have been selected. Clients are        moved from the Available box to the Selected box by highlighting        the client in the Available box and pressing the Add button        between the Available and Selected boxes. Clients are moved from        the Selected box to the Available box by highlighting the client        in the Selected box and pressing the Remove button between the        Available and Selected boxes. The Client Id tab also includes        radio buttons for “include” and “exclude.” Activating the        “include” radio button will cause the classification to include        the selected clients. Activating the “exclude” radio button will        cause the classification to exclude the selected clients.    -   Add, Delete, Accept, Restore, Show and Show All buttons. The Add        button adds a new classification. The Delete button deletes the        classification named in the Description field. The Accept button        accepts any changes made to the displayed classification. The        Restore button restores the defaults for the classification. The        Show button produces a pop-up window with a textual description        of the classification. The Show All button produces a pop-up        window with textual descriptions for all classifications.

These controls, and those shown on other screens, such as those shown inFIG. 29, constitute business concepts. By manipulating the controls, theDBA maps business concepts to TDWM features, including workloaddefinitions. Such a mapping provides the DBA a direct correlationbetween his or her business goals and the configuration of the system.If the DBA, as a business matter, decides to enhance one type ofperformance at the expense of another, these controls provide thecapability to do so.

An example exception criteria tab, illustrated in FIG. 35, provides atext box for the user to enter an excluded object, which can be a user,database, view, etc., which may be chosen from the database browser orentered by the user. An object type field is also provided. If theobject name is typed by the user, the user must provide an object type.If drag/drop is used to select an object from the database browser, thetype will be inferred. A text box 3605 is also provided for adescription. The description will appear if a tree view is selected.

An example workload period tab, illustrated in FIG. 36, will have thefollowing controls:

-   -   A drop-down list with all existing periods. The user will select        a period from the period drop-down list that will include the        entry “new.” If the user selects “new,” a dialog will appear for        the user to define a new period. The new period will then appear        in the tree view. A multi-line read only edit box will display a        description of the period selected.    -   Text boxes for service level goal parameters including:        -   Arrival rates;        -   Response Time (time value);        -   Throughput;        -   Service Percent; and        -   CPU Seconds per Query.    -   A text box for the maximum number of queries that can be        executing within the workload definition at any given time. In        some example systems, zero means no limit.

The example workload period tab provides an Exception Actions area whichdefines the processing options for exceptions. The processing optionswill be selected by radio buttons and check is boxes. The radio buttonsinclude:

No Action;

Abort; and

Continue.

Under the continue radio button, the following selections may be made:

-   -   “Log event” which causes the system to save information about        the exception;    -   “Change Workload” which causes the system to run the request        under new workload definition. In some example systems, a text        box (not shown) is provided to allow entry of the new workload        definition name.    -   “Raise Alert,” with a text box to enter the logical action name        for the alert    -   “Run Program” with a text box to enter the program name.

In the example shown, more than one continue action may be specified.

In the example workload period tab, the three radio buttons, (No Action,Abort, and Continue) are mutually exclusive. If Continue is chosen, atleast one of the check boxes must be checked. By default, when Continueis chosen, Log Event will be checked.

In the example shown, text boxes for Run Program and Raise Alert willaccept text strings.

The example shown includes the following buttons at the bottom of thepage: New, Delete, Accept and Restore. The New button establishes a newworkload period. The Delete button deletes the displayed workloadperiod. The Accept button accepts changes that have been made to thedisplayed workload period. The Restore button restores the values totheir defaults for the displayed period.

A set of summary tabs, illustrated in FIG. 37, provides the DBA withsummary information for all periods the DBA has defined for a workloaddefinition. The example in FIG. 37 shows the Allocation Group tab. Theother summary tabs include a Period Name tab, a Date/Time tab and aresource partition tab.

The TDWM Administrator will provide a property sheet wizard that willstep the user through the screens needed to completely specify a WD.These screens will be shown in the following order:

Workload Attributes, FIG. 32;

Workload Classification, FIG. 34;

Workload Exceptions, FIG. 33;

Workload Period, FIG. 36.

When the user creates a new workload definition, the administrator 405will create a blank workload classification (with no exclusions), aworkload period that references the default period that has no exceptioncriteria and no exception actions defined.

An example workload definition to allocation group mapping screen,illustrated in FIG. 38, provides the ability to map workload definitionsto allocation groups. The screen includes a multi-column workloaddefinition to allocation group mapping grid. The left-most column of thegrid includes the workload definition names. The center column includeslist boxes to choose allocation groups. The right-most column, which isonly displayed when the Advanced (Resource Partitions) checkbox isfilled in, displays the resource partition to which the workloaddefinition is assigned.

In some example systems, when an allocation group is first mapped to aworkload definition, the enforcement priority associated with theworkload definition is associated with the allocation group.

In some example systems, resource partition 1 (RP1) is reserved forworkload definitions with tactical enforcement priority. TheAdministrator assures that only allocation groups mapped to workloaddefinitions with tactical enforcement priority are placed in RP1.

The allocation group column has dropdown lists of allocation groups thatcan be associated with each workload definition. Only allocation groupswith the appropriate enforcement priority are displayed (includingallocation groups that have not yet been mapped). An “unassigned” listentry will be included and selected by default until the user chooses anallocation group.

In some example systems, a check box to “Include Default AGs” isincluded in the drop-down list. These are the allocation groupsassociated with the R, H, M and L PGs in RP0.

The spreadsheet may be sorted on any column. Further, the spreadsheetmay be sorted on multiple columns, i.e. by resource partition, then byallocation group, then by workload definition.

The user adds an allocation group by entering a name in the New AG namebox. The Add button will be enabled when text appears in the box. Whenthe user clicks the Add button, the allocation group is added to thegrid. Allocation group numbers are assigned by the administrator 405.

Allocation groups are not directly deleted. Allocation groups that haveno workload definitions referring to them are not written to the TDWMtables by the administrator 405 when a workload definition set is saved.

Operations

Examples of the basic functions that can be executed by the DBA are nowdescribed. For each function, the internal steps that Administrator willtake are listed.

In some example systems, only one DBA will be able to modify the TDWMdatabase at a time. While one DBA is modifying it, others may inspect itin read-only mode.

Enable Workload Management

When the DBA enables workload management, the administrator 405 performsthe following functions:

Check that TDWM tables have been created and initialized;

Read the TDWM configuration;

Read the TDWM PSF template from the DBMS;

Verify that the WD configuration is valid;

Verify that the PSF configuration is valid; and

Send a TDWM ENABLE command via PM/API.

Update Workload Management

When the DBA initiates an update to workload management, theadministrator 405 performs the following functions:

-   -   Verify that the WD configuration is valid;    -   Verify that the PSF configuration is valid;    -   Verify that Removed fields of appropriate tables are NULL if a        row is still active or set to date/time if deleted;    -   Create new row(s) and update existing row(s) in tables        containing the Workload information;    -   Update a table keeping track of; and    -   Enable the TDWM.        Disable Workload Management

When the DBA disables workload management, the administrator 405performs the following functions:

-   -   Send TDWM DISABLE command via PM/API. (In the DBMS, the        previously retained states of Category 1 & 2 TDWM and PSF are        restored).        PSF Configuration and Settings

The Administrator will create a PSF template for the DBMS. When TDWM isenabled or updated, the DBMS reads the TDWM PSF tables and completes thePSF definition, based on the template specification.

The DBMS analyzes the usage of PGs and AGs and maps virtual PG and AGassignments made by the TDWM Administrator to actual PGs and AGs.

Any time the TDWM workload definitions settings are updated in the DBMS,the PSF template settings are also be updated.

Workload Definition Operations

Create a WD

A user creates a new workload by selecting workload definition in thetree (FIG. 27), right clicking and choosing “New” from the pop-up menu.The following functions are then performed:

User fills in data in each detail screen;

Create WD on WD form; add WD attributes (FIG. 32);

Create WD classifications on classification form (FIG. 34);

Create or assign one or more WD periods on period form (FIG. 36);

Assign priority scheduler parameters; and

As each form is completed the administrator 405 will verify correctness.

Modify a WD

When the DBA selects a WD or WD subcomponent in the tree browser (FIG.27), the appropriate view displays the current settings. The followingfunctions are then performed:

-   -   DBA makes modifications to detail screen;    -   If the DBA clicks Accept Changes, the changes are saved in the        internal representation of the WD;    -   If the DBA clicks Cancel, or selects another tree node, the        previous settings are restored; and    -   Changed fields are saved for later update.        Enable/Disable a WD

When the DBA disables a WD the following functions are performed:

User selects WD or WD subcomponent in tree browser (FIG. 27); and

User chooses Enable or Disable.

Delete a WD

When the DBA disables a WD the following functions are performed:

User marks WD in tree browser (FIG. 27);

User chooses Delete; and

WD will have the removed field set to date/time when TDWM is updated.

Period, Exception Criteria, Exception Action

When the DBA wishes to create or modify a classification, period,exception criteria, or exception action for a WD the following functionsare performed:

-   -   When the user selects an existing item, it is displayed for        update;    -   When the user selects <New> item, a blank version is displayed        for update with fields set to defaults where appropriate;    -   The DBA makes changes;    -   If the DBA clicks Accept Changes, the changes are saved in the        internal representation of the item;    -   If the DBA clicks Cancel, or selects another tree node, the        previous settings are restored and the new item is deleted; and    -   Changed fields are saved for later Update.        Utility Mapping Table

Instances of Fastload, Multiload and, FastExport are subject to TDWMcontrol. The utilities are identified through logon partition.

Teradata load utilities are controlled through TDWM as a workloadlimitation. There is a limitation on the number of load utility requestsallowed in the system at one time. WDs for Load Utilities can be createdin the Administrator. If utility concurrency limits are exceeded, theincoming utility is rejected. The following functions are performed:

User chooses Modify Utility Mapping;

User makes modifications to utility mapping screen; and

Changed fields are saved for later Update.

Utility Rules

When the DBA wishes to create or modify utility rules the followingfunctions are performed:

The user chooses Utility WD or subcomponent in tree browser (FIG. 27);

The user makes modifications to utility detail screen; and

Changed fields are saved for later Update.

Deadlock Settings

When the DBA wishes to create or modify deadlock settings the followingfunctions are performed:

-   -   The user chooses Modify Settings;    -   The user selects the desired deadlock detection settings and        time periods (not to be confused with “Deadlock Timeout” in the        DBMS Control record); and    -   The administrator 405 sends the TDWM a command to inform the        DBMS of the new settings.        Console Utilities

For the purpose of managing Console Utilities and other functions, theDBMS needs to have a mapping of PGs to WDs. The administrator 405 willprovide the capability to map existing PGs to WDs. A table will bedefined in the TDWM database to maintain these mappings.

The administrator 405 will create four WDs that are mapped to the L, M,H, and R PGs. In some example systems, the DBA can create up to 35additional WDs.

The administrator 405 maps each console utility to a WD. A table isdefined in the TDWM database to maintain these mappings.

Performance Group to Workload Mapping

The administrator 405 will get a list of defined PGs from the PSF. Foreach PG, there will be a drop-down list for the DBA to choose theassociated WD. In one example system, the mappings for the R, H, M and LPG's are fixed:

Performance Group R maps to Workload Definition WD-R;

Performance Group H maps to Workload Definition WD-H;

Performance Group M maps to Workload Definition WD-M;

Performance Group L maps to Workload Definition WD-L.

In some example systems the mapping between PGs and WDs is automatic.

Console Utility to Workload Mapping

For some example systems, the list of Console Utilities is fixed andincludes:

CheckTable;

Configuration/Reconfiguration;

Ferret;

Query Configuration;

Query Session;

Recovery Manager;

Table Rebuild;

Filer; and

Replication Services.

For each Console Utility, there will be a drop-down list for the DBA tochoose the associated WD.

File and Other Operations

Get Profiler Recommendations for a WD

One possible set of functions involved in getting profilerrecommendations for a workload definition includes:

User marks WD in tree browser;

User chooses Get Classification Recommendations;

User selects classification parameters to analyze;

WD name and classification parameters are sent to Profiler;

The profiler 515 analyzes data and returns recommendation;

The administrator 405 displays recommendation to user;

User approves or disapproves recommendation; and

The administrator 405 applies the recommendation (see Modify).

Save a WD to a File

When saving a workload definition to a file, the following functions areperformed:

The user marks one or more WD's in the tree browser;

The user chooses Save; and

The administrator serializes the selected WD(s) and settings to a file.

Read a WD from a File

When reading a workload definition from a file, the following functionsare performed:

-   -   The user chooses Open;    -   The user selects file; and    -   The administrator 405 deserializes WD(s) from the file and        inserts it (them) into tree browser.        Save WDSet to a File

When saving a set of workload definitions, which may be all workloaddefinitions, to a file, the following functions are performed:

The user chooses Save All; and

The administrator 405 serializes all WDs and their settings into a file.

Read a WDSet from a File

When reading a set of workload definitions from a file, the followingfunctions are performed:

-   -   The user chooses Open;    -   The administrator checks to see if current values have been        changed and, if so, prompts to save;    -   The user selects a file; and    -   The administrator 405 removes existing WDs from the tree and        adds the new WDs.

Priority Scheduler Interface

In some example systems, the administrator 405 will provide the DBA theability to specify Priority Scheduler Facility parameters. Theadministrator will provide a simplified interface to define the keyparameters for PSF. The administrator will write these specifications totables in the TDWM database for the DBMS to use when TDWM is enabled.

The process of defining WDs is asynchronous with the enabling of TDWM.Consequently, the administrator 405 may not know which RPs, PGs and AGsare available at any particular time. Instead of specifying actual PSFobjects, the DBA will specify virtual PSF objects. Then, when TDWM isenabled, the DBMS will select actual PSF objects based on the existingPSF environment at that time. This frees both the administrator 405 andDBMS from trying to maintain disjoint sets of PSF objects.

The mapping of WDs to PGs is one to one, Consequently, there is no needto do the mapping in the administrator 405. This mapping will be done inthe DBMS when TDWM is enabled.

The DBA will have the capability of specifying these aspects of PSF:

For each WD, the Resource Partition and Allocation Group in that RP;

Resource Partitions (other than the Default RP) and RP weights; and

Allocation Groups and AG weights.

In one example system, each WD will use its own PG. Each PG will belongto a single WD. When TDWM is enabled, the DBMS will assign actual PGnumbers to WDs. Users will not be able to adjust PSF settings via eitherschmon command or PSA to avoid conflicts. Internal interfaces willchange PSF settings.

Basic system PGs ($R, $H, $M, $L) will remain for compatibility whenTDWM is disabled and the system reverts back to using account stringpriorities.

The administrator 405 will have an algorithm to calculate all PSFweights and other parameters. The DBA will have the ability to reviewand override them.

Flowcharts describing an example of the operation of the administratorwill now be described. In operation, as illustrated in FIG. 39, theadministrator 405 establishes rules, such as those shown in FIG. 24,limiting the requests that will be submitted to the database system forprocessing (block 3905). The administrator then establishes workloaddefinitions, again such as those shown in FIG. 24, that can be used tomap each request submitted to the database system for processing todatabase feature settings based on business concepts associated witheach request (block 3910).

The example process for establishing rules limiting the requests thatwill be submitted to the database for processing (block 3905), asillustrated in further detail in FIG. 40, includes establishingfiltering rules (block 3905) and establishing throttling rules (block4010). See the discussion regarding FIG. 25.

The example process for establishing filtering rules (block 4005), asillustrated in greater detail in FIG. 41, includes establishing rulesunder which requests submitted to the database system for processing arerejected (block 4105).

The example process for establishing throttling rules (block 4010), asillustrated in greater detail in FIG. 42, includes establishing rulesunder which requests submitted to the database system for processing aredelayed (block 4205).

The example process for establishing rules limiting the requests thatwill be submitted to the database system for processing (block 3905),illustrated in greater detail in FIG. 43, also include establishing“who” information, such as that shown in FIG. 26, such that thefiltering rules do not apply to requests with which such information isassociated (block 4305) and establishing “where” information, such asthat shown in FIG. 26, such that the throttling rules do not apply torequests with which such information is associated (block 4310).

The example process for establishing rules limiting the requests thatwill be submitted to the database system for processing (block 3905) mayalso include establishing “who” and “where” information, such as thatshown in FIG. 26, such that requests with which such information isassociated are delayed (block 4405), as illustrated in FIG. 44.

The process for establishing workload definitions (block 3910), asfurther illustrated in FIG. 45, includes establishing workloadclassification attributes (block 4505), using the screen shown in FIG.34. Workload throttling attributes are established (block 4510), usingthe screen shown in FIG. 32. Workload exception attributes areestablished (block 4415), using the screens shown in FIGS. 33 and 36.Workload prioritization attributes are established (block 4520), usingthe screen shown in FIGS. 29-31. Workload enforcement prioritizationattributes are established (block 4525), using the screen shown in FIG.32.

The process of establishing workload classification attributes (block4505), as further illustrated in FIG. 46, includes for each workloaddefinition, identifying one or more business concepts, such as thoseshown in FIG. 34, associated with requests that will identify requeststo be classified to that workload (block 4505).

The process of establishing workload throttling attributes (block 4510),as further illustrated in FIG. 47, includes for each workloaddefinition, identifying one or more attributes of requests classified tothat workload that determine if such requests are rejected, throttled,or run with special privileges (block 4510).

The process of establishing workload exception attributes (block 4515),as further illustrated in FIG. 48, includes identifying exceptionconditions, such as those shown in FIG. 33, for a selected workloaddefinition (block 4805). The threshold that determines when theexception condition has occurred is identified (block 4810). An actionto be taken when the threshold associated with the exception conditionis crossed, such as those illustrated in FIG. 36, is identified (block4815). If there are more exception conditions (block 4820), blocks 4810and 4815 are repeated. If there are more workload definitions (block4825), blocks 4805, 4810 and 4815 are repeated.

The administrator 405 process, illustrated in FIG. 39, also includesproviding a tree view, such as that shown in FIG. 27 of the mapping(block 4905), as illustrated in FIG. 49: This process, furtherillustrated in FIG. 50, includes providing a first node for the rules(block 5005). A second node for the workload definitions is provided(block 5010). A third node for priority scheduling is also provided(block 5015).

The exception monitor 615 of the regulator 415, shown in more detail inFIG. 51, includes a subsystem condition detector and adjuster (SSCDA)5105 and a system condition detector and adjuster (SCDA) 5110. As shownin FIG. 52, in one example system there is one SCDA 5110 for the entiresystem. In some example systems, one or more backup SCDAs (not shown)are also provided that will operate in the event that SCDA 5110malfunctions.

There is one SSCDA 5105 per dispatcher, as shown in FIG. 52. This is nota limitation, because, as indicated in FIG. 52, some example systems mayhave more than one SSCDA 5105 per dispatcher. In addition, some examplesystems have only one dispatcher per parsing engine, although this isnot a limitation of the concept described herein. Further, in someexample systems each parsing engine may run on a single node or acrossmultiple nodes. In some example systems, each node will include a singleparsing engine. Thus, for example, there may be one SSCDA per AMP, oneper parsing engine, or one per node.

Returning to FIG. 51, the SCDA monitors and controls resourceconsumption at the system level, while the SSCDA monitors and controlsresource consumption at the subsystem level, where in some examplesystems, a subsystem corresponds with a single dispatcher. As mentionedabove, some subsystems may correspond to a share of a dispatcher.Further, a subsystem may correspond to more than one dispatcher.

Each SSCDA monitors and controls, in a closed loop fashion, resourceconsumption associated with a single subsystem. An SSCDA monitorsthroughput information that it receives from the request processor 625and compares that performance information to the workload rules 409. TheSSCDA then adjusts the resource allocation in the request processor 625to better meet the workload rules.

The SCDA receives system conditions, compares the conditions to theworkload rules, and adjusts the system resource allocations to bettermeet the system conditions. For convenience, FIG. 51 shows the SCDAreceiving inputs from and sending outputs to the request processor 625.In another example system, the inputs and outputs to and from the SCDAare handled as described below with respect to FIG. 53.

Generally, the SSCDA provides real-time closed-loop control oversubsystem resource allocation with the loop having a fairly broadbandwidth, for example on the order of a millisecond⁻¹. The SCDAprovides real-time closed-loop control over system resource allocationwith the loop having a narrower bandwidth, for example on the order of asecond⁻¹.

Further, while the SSCDA controls subsystem resources and the SCDAcontrols system resources, in many cases subsystem resources and systemresources are the same. The SCDA has a higher level view of the state ofresource allocation because it is aware, at some level as discussed withrespect to FIG. 53, of the state of resource allocation of allsubsystems, while each SSCDA is generally only aware of the state of itsown resource allocation. A system may include some resources that areshared at a system level. Such resources would be truly system resourcescontrolled by the SCDA.

The system conditions include:

-   -   Memory—the amount of system and subsystem memory currently being        used. It is possible that the system will include some memory        that is shared among all of the subsystems.    -   AMP worker tasks (AWT)—the number of available AWTs. An AWT is a        thread or task within an AMP for performing the work assigned by        a dispatcher. Each AMP has a predetermined number of AWTs in a        pool available for processing. When a task is assigned to an        AMP, one or more AWTs are assigned to complete the task. When        the task is complete, the AWTs are released back into the pool.        As an AMP is assigned tasks to perform, its available AWTs are        reduced. As it completes tasks, its available AWTs are        increased.    -   FSG Cache—the amount of FSG cache that has been consumed. The        FSG cache is physical memory that buffers data as it is being        sent to or from the data storage facilities.    -   Arrival Rates—the rate at which requests are arriving. Arrival        rate can be broken down and used as a resource management tool        at the workload basis.    -   Co-existence—the co-existence of multiple types of hardware.    -   Skew—the degree to which data (and therefore processing) is        concentrated in one or more AMPs as compared to the other AMPs.    -   Blocking (Locking)—the degree to which data access are blocked        or locked because other processes are accessing data.    -   Spool—the degree of consumption of disk space allocated to        temporary storage.    -   CPU—the number of instructions used per second.    -   I/O—the datablock I/O transfer rate.    -   Bynet latency—the amount of time necessary for a broadcast        message to reach its destination.

One example of the way that the SCDA 5110 may monitor and control systemresource allocations is illustrated in FIG. 53. The SSCDAs are arrangedin a tree structure, with one SSCDA (the root SSCDA 5305) at the top ofthe tree, one or more SSCDAs (leaf SSCDAs, e.g. leaf SSCDA 5310) at thebottom of the tree, and one or more intermediate SSCDAs (e.g.intermediate SSCDA 5315) between the root SSCDA and the leaf SSCDAs.Each SSCDA, except the root SSCDA 5305, has a parent SSCDA (i.e. theimmediately-higher SSCDA in the tree) and each SSCDA, except the leafSSCDA, has one or more child SSCDA (i.e. the immediately lower SSCDA inthe tree). For example, in FIG. 53, SSCDA 5315 is the parent of SSCDA5310 and the child of SSCDA 5320.

In the example shown in FIG. 53, the tree is a binary tree. It will beunderstood that other types of trees will fall within the scope of theappended claims. Further, while the tree in FIG. 53 is symmetrical,symmetry is not a limitation.

The SCDA 5110 gathers system resource information by broadcasting to allSSCDAs a request that they report their current resource consumption. Inone example system, each SSCDA gathers the information related to itsresource consumption, as well as that of its children SSCDAs, andreports the compiled resource consumption information to its parentSSCDA. In one example system, each SSCDA waits until it has receivedresource consumption information from its children before forwarding thecompiled resource consumption information to its parent. In that way,the resource consumption information is compiled from the bottom of thetree to the top. When the root SSCDA 5305 compiles its resourceconsumption information with that which is reported to it by itschildren SSCDAs, it will have complete resource consumption informationfor the SSCDAs in the system. The root SSCDA 5305 will report thatcomplete information to the SCDA. The SCDA will add to that informationany resource consumption information that is available only at thesystem level and make its resource allocation adjustments based on thosetwo sets of information.

In another example system, each of the SSCDAs communicates its resourceconsumption information directly to the SCDA 5110. The SCDA 5110compiles the information it receives from the SSCDAs, adds system levelresource consumption information, to the extent there is any, and makesits resource allocation adjustments based on the resulting set ofinformation.

There are at least two ways by which the SCDA 5110 can implement itsadjustments to the allocation of system resources. The first,illustrated in FIG. 51, is for the SCDA 5110 to communicate suchadjustments to the request processor 625. The request processor 625implements the adjustments to accomplish the resource allocationadjustments.

Alternatively, the SCDA 5110 can communicate its adjustments to theSSCDAs in the system, either directly or by passing them down the treeillustrated in FIG. 53. In either case, the SSCDAs incorporate theSCDA's resource allocation adjustments in the subsystem resourceallocation adjustments that it sends to the request processor 625.

These techniques for communication between the SCDA 5110 and the SSCDAscan be to accomplished by a single process running across all of thenodes and all of the AMPS, by multiple processes, where each processexecutes on a separate AMP, or by processes that can run on more thanone, but not all, of the AMPs. “Process” should be interpreted to meanany or all of these configurations.

Since the SCDA 5110 has access to the resource consumption informationfrom all SSCDAs, it can make resource allocation adjustments that aremindful of meeting the system workload rules. It can, for example,adjust the resources allocated to a particular workload group on asystem-wide basis, to make sure that the workload rules for thatworkload group are met. It can identify bottlenecks in performance andallocate resources to alleviate the bottleneck. It can remove resourcesfrom a workload group that is idling system resources. In general, theSCDA 5110 provides a system view of meeting workload rules while theSSCDAs provide a subsystem view.

Source Identification

Conventional database systems typically capture information about thesource of a request when the request is received. The information mayidentify the source application that sent the request to the DBMS andmay also include other information about the request, such as when therequest was transmitted to the DBMS. Examples of such informationinclude: client source ID (external application name or ID), accountname, account string, user name, date, time, request number, host ID,host type, etc. Much of this information is specific to the RDBMS anddoes not include information outside the domain of the database.Examples of such non-RDBMS-specific information includes external userID, external click stream data, external web user, external applicationname, kind of application, and so on.

This information may be stored in the Query Log 505 and used by theAdministrator 405, as described with respect to FIGS. 5 and 16, tocreate and manage workload definitions and workload groups. For example,the Administrator 405 may determine that the requests from a particularsource are not being processed quickly enough and should be included ina workload group with service level goal set to a shorter response time.Part of that decision may be related to the identity of the source. Thatis, knowledge by the Administrator that a particular source requiresshort responses may effect the workload group assignment of requestsfrom that source.

In some situations, such as those illustrated in FIGS. 54 and 55, thetrue source of the request may be hidden. In a session pool (orconnection pool), shown in FIG. 54, the DBMS 100 maintains a number ofsessions (or connections). An application 5405 seeking to submit arequest to the DBMS is allocated one of the sessions and the request istransmitted to the DBMS in association with that session, but possiblywithout the information that describes the source. The session controlblock (block 200 in FIG. 2) may keep track of the session thatoriginated the request but the session control block 200 might not haveinformation as to the application 5405 that is the source of therequest.

Similarly, in a multi-tier architecture, such as that shown in FIG. 55,numerous applications 5505, 5510, 5515, and 5520 submit requests toanother application 5525 that in turn forwards the requests to the DBMS100. Again, the identity of the true source of each request (one ofapplications 5505, 5510, 5515 and 5520) may not be included with therequest and therefore may not be available for workload managementpurposes.

DBMS 100 provides an ability to receive, store (for example, log in theQuery Log 505) and process information regarding the true source orsources of a request by allowing for receipt of a message that containssuch information. Such a message may contain information indicating, notjust the originating application of a request that follows or isincluded with the message, but also any intermediate applications thatpass the request from the originating application to the DBMS 100. Forexample, referring to FIG. 55, a message originating with application5505 may contain identification information for application 5505 andapplication 5525. The identification information for each application isadded by that application as it is being passed toward the DBMS 100.

The identification information can take any form that is meaningful tothe DBMS or that is meaningful to the originating application, to anyintermediate application, to the accounting application for any of theoriginating or intermediate applications, or to any other application towhich such identification information would be useful.

An example syntax for the message is shown below:

-   -   SET SESSION gbid(client_login_id=FOO; applid=Accounting,        external_user_id=foo, LDAP=/usr/ntos/bin/userx,        click_stream_id=market_Basket, etc.)

The SET SESSION message from a source may establish identificationinformation for the single request from that source that follows the SETSESSION message. Alternatively, it may establish identificationinformation for all requests from that source until a new SET SESSIONmessage is received. In addition, the SET SESSION message can be sent inthe same parcel as the following request, which means the user is notrequired to wait for a synchronous (ACK) message. An example of thiswould be a multi-statement request prefaced by the SET SESSION message.In this case, all of the requests are interpreted as one request and theSET SESSION information applies to all of the statements in the request.

In the example shown, the “gbid” function causes the information in theparentheses to be stored in the Query Log 505, where it will beavailable for use in creating and maintaining workload definitions andworkload groups. In the example shown, the information within theparentheses is made up of value-name pairs. Each value-name pairincludes a source-identifying parameter (e.g., “client_login_id”), aconnector (e.g., “=”), and a value (e.g., “FOO”) for thatsource-identifying parameter. In this example, the source-identifyingparameters and the values associated with those parameters may beassigned by the application. Examples of other value-name pairs include:MSTRUSER (RequestSource User), REPORT (report name), REPORTGUID (reportGUID), REPORTCOST (cost assigned to the RequestSource report),REPJOBSESSION (session GUID), REPJOBID (job ID assigned by theRequestSource Server), SQLPASSID (sequence number of the SQL pass withina report), MSTRPRIORITY (priority of the report within the RequestSourceServer), DOCUMENT (document name), DOCJOBID (document job ID), FLAG1(binary flag), LOGTMSTMP (timestamp at which application issues SQLrequest), LOGDATE (date at which application issues SQL request),CLIENTMACHINE (name or IP address of the client machine), WEBSRVRMACHINE(name or IP address of the web server machine responsible for the reportrequest), MSTRSRVRMACHINE (name or IP address of the RequestSourceIntelligence Server Machine), MSTRPROJECT (project name), PROJECTGUID(project GUID), APPLICATIONTYPE (name of the client application of theRequestSource Server), SERVERINSTNAME (name of the server instancesubmitting this request), REQUESTTYPE (type of RequestSource Request),REPORTTYPE (flag denoting type of the RequestSource report).

In the example shown above, after a SET SESSION message makes its waythrough a hierarchical structure, such as that shown in FIG. 55, it maycontain value-name pairs identifying the originating application (e.g.,application 5505) and any intermediate applications (e.g., application5525) it traversed before reaching the DBMS 100.

In addition, the message may capture timestamp information as it isrouted to a DBMS. For example, in passing through a system such as thatshown in FIG. 55, the SET SESSION command may acquire value-name pairsassociated with the date and time the message was processed (ortransmitted, etc.) by the originating application and when it wasprocessed (or received or transmitted, etc.) by an intermediateapplication. An example of the use of such timestamp information is intracking heartbeat query times, step by step, to identify where in thehierarchical structure the query encounters delays. Further, thisfeature provides additional debugging and supportability capabilitiesbecause internal middle tier applications can insert SET SESSIONinformation into a message, which allows the RDBMS to collect internalnetwork and/or client information. The ability to gather thisinformation can be beneficial to clients.

Source Identification in Multi-Database Systems

Identifying the source of a request is also an issue in a multi-databasesystem, such as the system 5602 illustrated in FIG. 56. An additionalmulti-database system layer is added to the routing and processing ofrequests, which increases the challenge of tracking the source of suchrequests. The context of the multi-database system 5602 will first bediscussed followed by a discussion of a query-band solution.

FIG. 56 illustrates one embodiment of a multi-database system 5602having a plurality of system databases of the type illustrated inFIG. 1. In one embodiment, one or more gateways (“GW”) 5604 provide aninterface from a local area network (“LAN”) or other communicationsnetwork, such as the Internet or a wireless network, to a network 5606that interconnects the components of the multi-database system 5602. Inone embodiment, the gateways 5604 receive messages from a LAN andconvert them to a message format used on the network 5606. In oneembodiment, this entails encapsulating messages received via the LAN ina wrapper appropriate for the network 5606.

In one embodiment, the virtual parsing engines (“PE”) 5608 a-i performthe functions of the parsing engine 130 described above. In oneembodiment, however, the virtual parsing engines 5608 a-i are notfixedly assigned to a set of processing modules 110. Instead, themapping between virtual parsing engines 5608 a-i and processing modules110 is variable depending on the current needs of the system. In oneembodiment, one of the virtual parsing engines, 5608 a, serves as avirtual regulator, providing the functions described in co-pending U.S.patent application Ser. No. 11/891,919, entitled “Dynamic QueryOptimization Between Systems Based On System Conditions,”, incorporatedby reference.

In one embodiment, Access Module Processors (“AMPs”) 5610 a-h, which aregenerally equivalent to the processing modules 110 _(. . . N) shown inFIG. 1, are grouped as shown by the dashed boxes 5612 a-d in FIG. 56. Inone embodiment, each group 5612 a-d is a DBS 100 (or system database).In one embodiment, each system database 5612 a-d is assigned one or morevirtual PEs 5608 a-i. In the example shown in FIG. 56, virtual PE 5608 ais assigned to system database 5612 a as indicated by the dashed boxenclosing that item. Further, virtual PEs 5608 b and 5608 c are assignedto system database 5612 b, virtual PEs 5608 e and 5608 f are assigned tosystem database 5612 c, and virtual PEs 5608 g, 5608 h, and 5608 i areassigned to system database 5612 d. Virtual PE 5608 d is not assigned toany system database and is being held “in reserve.” In one embodiment,hash maps 5614 a-d identify which system database and AMP 5610 a-h is toreceive a message directed to one of the system databases 5612 a-d. Forexample, if a message is directed to system database 5612 a, the virtualPE 5608 a that is assigned to system database 5612 a will use hash map5614 a to determine if the message is to be delivered to AMP 5610 a orAMP 5610 b. Some of the AMPs in FIG. 56, such as AMP 5610 c, arerepresented as overlapping circles, indicating that AMP 5610 c is aplurality of AMPs. Generally, in one embodiment, the groups 5612 a-d cancontain any number of AMPs. Each system database 5612 a-d includes areplication service group (“RSG”) 5616 that coordinates applying changesmade to data in one system database to the same data replicated inanother system database.

FIG. 57 illustrates an embodiment in which virtual PE 5608 a acts as avirtual regulator with the other PEs 5608 b-i in a hierarchicalarrangement. In one embodiment illustrated in FIG. 57 the virtualregulator 5608 a includes a plurality of cooperatively operating PEs.Similarly, groups of PEs 5608 b-i can be associated with a single systemdatabase, as shown in FIG. 56 and discussed above.

In one embodiment, such as that shown in FIG. 57, PEs 5608 b-i are usedto manage workloads on an individual system database 5612 a-d basis. Avirtual regulator 5608 a comprises a modified regulator, as that term isdefined in U.S. Utility patent application Ser. No. 10/915,609,incorporated by reference, implemented to enhance a closed-loop systemmanagement to (CLSM) architecture in a multi-database system 5602. Thatis, by extending the functionality of the regulator components, complexworkloads are manageable across the multi-database system 5602.

The function of the virtual regulator 5608 a is to control and manageworkloads across all DBS 100 in a multi-database system 5602. Thefunctionality of the virtual regulator 5608 a extends the existinggoal-oriented workload management infrastructure, which is capable ofmanaging various types of workloads encountered during processing.

In one embodiment, the virtual regulator is not just a PE but includesall the other elements of one of the system databases, such as systemdatabase 5612 a. In that case, the virtual regulator includes AMPs 5610a and 5610 b, which provide the virtual regulator with a persistencelayer for data protection, a hash map 5614 a, and an RSG 5616.

In one embodiment, the virtual regulator 5608 a includes a “thin”version of a DBS 100, where the “thin” DBS 100 is a DBS 100 executing inan emulation mode, such as described in U.S. Pat. Nos. 6,738,756,7,155,428, 6,801,903 and 7089258, all of which are incorporated byreference herein. A query optimizer function 320 of the “thin” DBS 100allows the virtual regulator 5608 a to classify received queries into“who, what, where” classification criteria, and allows a workload querymanager (see application Ser. No. 11/891,919, referenced above) of the“thin” DBS 100 to perform the actual routing of the queries amongmultiple DBS 100 in the multi-database system 5602. In addition, the useof the “thin” DBS 100 in the virtual regulator 5608 a provides ascalable architecture, open application programming interfaces (APIs),external stored procedures (XSPs), user defined functions (UDFs),message queuing, logging capabilities, rules engines, etc.

The virtual regulator 5608 a also includes a set of open APIs, known as“Traffic Cop” APIs, that provide the virtual regulator 5608 a with theability to monitor DBS 100 states, to obtain DBS 100 status andconditions, to activate inactive DBS 100, to deactivate active DBS 100,to set workload groups, to delay queries (i.e., to control or throttlethroughput), to reject queries (i.e., to filter queries), to summarizedata and statistics, and to create dynamic operating rules. The TrafficCop APIs are also made available to all of the regulators 5608 b-i foreach DBS 100, thereby allowing the PEs 5608 b-i for each DBS 100 and thevirtual regulator 5608 a for the multi-database system 5602 tocommunicate this information between themselves.

In some exemplary environments one or more backup virtual regulators,illustrated in FIG. 57 by the boxes stacked behind the virtual regulator5608, are also provided for circumstances where the primary virtualregulator 5608 a malfunctions or is otherwise unavailable. Such backupvirtual regulators may be active at all times or may remain dormantuntil needed.

In some embodiments, each PE 5608 b-i communicates its system conditionsand operating environment events directly to the virtual regulator 5608a. In other embodiments, each PE 5608 a-i may have superordinate and/orsubordinate PEs. For example, in FIG. 57, PE 5608 f has superordinate PE5608 a and subordinate PEs 5608 g and 5608 h. In such embodiments, eachPE 5608 b-i gathers information related to its own system conditions andoperating environment events, as well as that of its childrenregulators, and reports the aggregated information to its parentregulator or the virtual regulator 5608 a at the highest level of themulti-database system 5602.

In one embodiment, query statistics at the system database level aregathered as described above in connection with FIG. 12. In oneembodiment, each system database's channel subsystem reports the stepstatistics to a multi-system channel subsystem, which facilitatescommunications by the multiple system databases over the network 5606.In one embodiment, the multi-channel subsystem compiles statistics,including the total amount of processing time needed by all systemdatabases 5612 a-d in the multi-database system 5602 to fully executeeach query step and the total number of I/O operations performed by allsystem databases 5612 a-d during execution of the query step. Themulti-channel subsystem communicates the aggregated statistics to thevirtual regulator 5608 a, which stores the statistics in the DBQL cache5705.

In one embodiment, the virtual regulator 1308 a compiles the informationreported by the subordinate PEs 1308 b-i and the information reported bythe multi-system channel subsystem, adds multi-database 1302 oradditional system level information, to the extent there is any, intolog entries. The log entries are temporarily stored in a Database QueryLog(DBQL) cache 1405.

It is often useful for sessions, applications, and user requests to becoupled in such a way that they can be easily and uniquely identifiedfrom their origin to their terminus in a multi-database system such asthat just described. For example, consider a simple case in which adirectory user, which could be any externally authenticated user, isauthorized only for a profile and a set of roles in the directory. Inone embodiment, these type of users appear as EXTUSER in a sessiontable.

External users that authenticate and authorize access to themulti-database system 5602 through such external agents may becomenon-unique in the view of the multi-database system 5602 because of theexternal agent's (and potentially the user's) naming convention. Forexample, the multi-database system 1302 may use a “quicklook ID” as away to distinguish users or sessions. Further, the multi-database system1302 may use a quicklook ID of MSIXXXXX. One user's directory user namemight be “cn=MSI,du-users,ou=northamerica,dc=TD,dc=company,dc=com” whileanother user's directory name might be“cn=MSl,du-users,ou=asia,dc=TD,dc=company,dc=com,” with no differencebetween the two user names except in the “ou” field. In that case, theuse of the quicklook ID would not distinguish the two users. Somethingfurther is needed.

In one embodiment, the technique determines the external source of arequest from: a) session pooling environment; b) a multi-tieredapplication environment; or c) any other source of heterogeneousrequests for a multi-system environment. In one embodiment, capturingand logging the original source identification across multiple systemsenables applications to play a role in workload management, working incooperation with the multi-database system 5602, to the specific querieswithin the heterogeneous mix of overall queries it submits. In oneembodiment, such identification also enables more granular accounting ofrequests by those granular groupings, enabling improved performancetuning opportunity identification, capacity planning and performancemonitoring, by linking other data captures, such as the multi-systemquery log with the granular originating source. In one embodiment, suchidentification removes the need for the DBA to setup complicated tracingand logging mechanisms.

In one embodiment, the existing request source information (Account,Session, Request Number) is supplemented with information generated andsent from the originating “top tier” application. In one embodiment,this includes the user ID at that top tier as well as the name of thetop tier application. In one embodiment, it will also include moregranular information about the type of request available within thescope of that application (e.g. security, inventory, churn, fraud,marketing, sales, etc, or web page in which the query request camefrom), thereby providing more specific identification of the request andits purpose. There may be hundreds of ‘top tier’ applications that feeda particular ‘middle-tier’ server, and even more request purposes fromwithin those top tier applications. In one embodiment, the sourceidentifiers used will be optionally customizable by those who manage themulti-systems so that the identifiers can have effective meanings. Themulti-database system 5602 will provide a mechanism to passquery-specific information on to the database systems 5612 a-d, even inan environment of, or simulation of, session pooling. In one embodiment,the issue to being resolved here is when a user logs on via sessionpooling, or a simulation of session pooling, the user, account andlogonsource passed at time of logon/connect are common for a quicklogon. The mechanism works within these constraints.

In one embodiment, the new identification information is capable ofbeing captured by third parties such that their accounting buckets canbe in sync with the granular buckets available at the multi-databasesystem 1302 or application level. In one embodiment, in addition tocapturing originating user and request type information from the toptier application, the identifier captures timestamp information.Capturing timestamp information enables analysts to have point-to-pointmeasures captured, to distinguish query times from the various systemsas it traverses the full multi-system path: from request initiation atthe top tier to the multiple database systems within the multi-databasesystem and back again.

In one embodiment, in an environment of many levels or tiers in theenterprise through which a request passes, the identificationinformation is captured at each location in the multi-database systemenvironment it traversed. In one embodiment, at each location, atimestamp, user and system server information is captured. In oneembodiment, this information is used to track heartbeat query times,step by step, to identify where in the multi-database system environmentthe query encounters delays, etc. In one embodiment, this techniqueenables identification of bottlenecks beyond a single database system.In one embodiment, a multi-database system element provides a timelineof query response times by system as a form of feedback reporting.

In one embodiment, the database systems 1312 a-d identify requestsources as discussed above in the section entitled “SourceIdentification.” In the multi-database system 1302 an additional elementis added. In one embodiment, when the virtual regulator 5608 a receivesa user session request, such as a query or a utility or DML statement,it processes the request as described above with respect to FIGS. 3 and4 to produce executable steps. In one embodiment, illustrated in FIG.58, when the virtual regulator forwards the executable steps to one ormore of the subordinate PEs 1308 b-h, it creates a query-band (block5805) and includes it with the executable steps or transactions (block5810). This is illustrated in FIG. 57, which shows an executable step5710 for a transaction identified by a query-band 5715 being transmittedfrom the virtual regulator 5608 a to one of the subordinate PEs 5608 b.The executable step 5710 includes the query-band 5715. In oneembodiment, the query-band is an identifier that uniquely identifies thesession and the request among the plurality of sessions and plurality ofrequests being processed by the multi-database system at the time thatthe request was submitted.

In one embodiment, the query-band is created by deriving an arbitrarystring of characters from an identification of the session, such as asession ID, and an identification of the request, such as a request ID.In one embodiment, the arbitrary string of characters is derived byconcatenating the identification of the session and the identificationof the request. In one embodiment, the arbitrary string of characters isderived using a hash operation. For example, a hash function may be anindex into a table in which one dimension is the identification of thesession, another dimension is the identification of the request, and thecontents of the table are the resulting hash values. In one embodiment,the arbitrary string of characters is derived from a time stamp, such asthe time the request was submitted. In one embodiment, other informationregarding the session or the request is used to formulate thequery-band.

Thereafter, in one embodiment, when one of the subordinate PEs 5608 b-hreports status to the virtual regulator 5608 a, it segments the statusby query-band and includes the query-band in the status report (block5815). This is illustrated in FIG. 57, which shows a status report 5720for a subordinate PE 5608 b for the work it is doing on a transactionidentified by a query-band 5725 being transmitted to the virtualregulator 5608 a. The status report 5720 includes the query-band 5725.For example, in one embodiment, the status reports are segmented bysession and request and the status report for a particular requestincludes the query-band that was created for the request. The virtualregulator 5608 a stores the status reports in the DBQL cache 5705 (block5820).

The status reports that include query-bands can be useful in a varietyof ways. They can be used to increase the granularity and precision ofmanagement and control, as discussed above. In addition, in oneembodiment, if part or all of one of the database systems 5612 a-d fails(block 5825) and it is desired to continue the processing of atransaction being processed by the failed database system, the state ofthe failed database system as it relates to that transaction can bereconstructed from the status reports in the DBQL cache identified bythe query-bands for the request attached to the status reports (block5830). In one embodiment, the state includes some or all of thefollowing: a system database identifier, a system database name, acharacter set, a spool name or names, global table names, transactionidentifiers, global temporary table names, views, external user IDs,LDAP to name, and other similar information. In one embodiment, anotherdatabase system 5612 a-d that has not failed and that has access to thesame data necessary to process the transaction as the failed databasesystem can then be set to the reconstructed state (block 5835),processing of the transaction can be completed (block 5840), processingof the request can be completed producing a result (block 5845), and theresult can be stored (block 5850). In one embodiment, the replacementdatabase system has access to the same data as the failed databasesystem by design; i.e., the replacement database system holds aduplicate of the data necessary to process the transaction held by thefailed database system. In one embodiment, the replacement databasesystem has access to the same data necessary to process the transactionas the failed database system because the data was replicated to thereplacement database system by the RSGs 1316.

In one embodiment, during the query optimization process the virtualregulator 5608 a narrowed the choice of database system to process therequest to between the failed database system and the replacementdatabase system and chose the failed database system.

The text above described one or more specific embodiments of a broaderinvention. The invention also is carried out in a variety of alternativeembodiments and thus is not limited to those described here. Forexample, while the invention has been described here in terms of a DBMSthat uses a massively parallel processing (MPP) architecture, othertypes of database systems, including those that use a symmetricmultiprocessing (SMP) architecture, are also useful in carrying out theinvention. The foregoing description of the preferred embodiment of theinvention has been presented for the purposes of illustration anddescription. It is not intended to be exhaustive or to limit theinvention to the precise form disclosed. Many modifications andvariations are possible in light of the above teaching. It is intendedthat the scope of the invention be limited not by this detaileddescription, but rather by the claims appended hereto.

What is claimed is:
 1. A method for recovering from a failure of asoon-to-fail database system among a plurality of database systems in amulti-database system in processing a request submitted to themulti-database system through a multi-database system session, themethod comprising: creating a query band for the request, the query bandbeing defined to be an identifier that uniquely identifies the sessionand the request among the plurality of sessions and plurality ofrequests being processed by the multi-database system at the time thatthe request was submitted; attaching the query band to a transactionissued by the multi-database system to the soon-to-fail database systemto execute the request; reporting a status concerning execution of thetransaction by the soon-to-fail database system, the status includingthe query band; logging the status; detecting the failure of thesoon-to-fail database system; reconstructing a state of the soon-to-faildatabase system from the logged status as the state related to theprocessing of the transaction using the query band; using thereconstructed state to continue processing of the transaction by analternative database system, the alternative database system being oneof the plurality of database systems in the multi-database system;processing the request to produce a result; and storing the result. 2.The method of claim 1 further comprising: selecting the soon-to-faildatabase system to perform a transaction required to execute the query,the selection being between the soon-to-fail database system and thealternative database system, the soon-to-fail database system and thealternative database system having the access to data necessary toperform the transaction.
 3. The method of claim 1 wherein reporting thestatus concerning execution of the transaction by the soon-to-faildatabase system comprises: reporting the status to a logging subsystem.4. The method of claim 1 wherein creating the query band for the requestcomprises deriving an arbitrary string of characters from anidentification of the session and an identification of the request. 5.The method of claim 4 wherein deriving the arbitrary string ofcharacters comprises concatenating the identification of the session andthe identification of the request.
 6. The method of claim 4 whereinderiving the arbitrary string of characters comprises using a hashoperation.
 7. The method of claim 4 wherein deriving the arbitrarystring of characters comprises using the time the request was submitted.8. A database system, the system comprising: one or more nodes; aplurality of CPUs, each of the one or more nodes providing access to oneor more CPUs; a plurality of virtual processes, each of the one or moreCPUs providing access to one or more virtual processes; each virtualprocess configured to manage data, including rows from the set ofdatabase table rows, stored in one of a plurality of data-storagefacilities; a process for recovering from a failure of a soon-to-faildatabase system among a plurality of database systems in amulti-database system in processing a request submitted to themulti-database system through a multi-database system session by:creating a query band for the request, the query band being defined tobe an identifier that uniquely identifies the session and the requestamong the plurality of sessions and plurality of requests beingprocessed by the multi-database system at the time that the request wassubmitted; attaching the query band to a transaction issued by themulti-database system to the soon-to-fail database system to execute therequest; reporting a status concerning execution of the transaction bythe soon-to-fail database system, the status including the query band;logging the status; detecting the failure of the soon-to-fail databasesystem; reconstructing a state of the soon-to-fail database system fromthe logged status as the state related to the processing of thetransaction using the query band; using the reconstructed state tocontinue processing of the transaction by an alternative databasesystem, the alternative database system being one of the plurality ofdatabase systems in the multi-database system; processing the request toproduce a result; and storing the result.
 9. The database system ofclaim 8 wherein the process further comprises: selecting thesoon-to-fail database system to perform a transaction required toexecute the query, the selection being between the soon-to-fail databasesystem and the alternative database system, the soon-to-fail databasesystem and the alternative database system having the access to datanecessary to perform the transaction.
 10. The database system of claim 8wherein reporting the status concerning execution of the transaction bythe soon-to-fail database system comprises: reporting the status to alogging subsystem.
 11. The database system of claim 8 wherein creatingthe query band for the request comprises deriving an arbitrary string ofcharacters from an identification of the session and an identificationof the request.
 12. The database system of claim 11 wherein deriving thearbitrary string of characters comprises concatenating theidentification of the session and the identification of the request. 13.The database system of claim 11 wherein deriving the arbitrary string ofcharacters comprises using a hash operation.
 14. The database system ofclaim 11 wherein deriving the arbitrary string of characters comprisesusing the time the request was submitted.
 15. A non-transitorycomputer-readable storage medium, for recovering from a failure of asoon-to-fail database system among a plurality of database systems in amulti-database system in processing a request submitted to themulti-database system through a multi-database system session, theprogram comprising executable instructions that cause a computer to:create a query band for the request, the query band being defined to bean identifier that uniquely identifies the session and the request amongthe plurality of sessions and plurality of requests being processed bythe multi-database system at the time that the request was submitted;attach the query band to a transaction issued by the multi-databasesystem to the soon-to-fail database system to execute the request;report a status concerning execution of the transaction by thesoon-to-fail database system, the status including the query band; logthe status; detect the failure of the soon-to-fail database system;reconstruct a state of the soon-to-fail database system from the loggedstatus as the state related to the processing of the transaction usingthe query band; use the reconstructed state to continue processing ofthe transaction by an alternative database system, the alternativedatabase system being one of the plurality of database systems in themulti-database system; process the request to produce a result; andstore the result.
 16. The non-transitory computer-readable storagemedium of claim 15 further comprising executable instructions that causethe computer to: select the soon-to-fail database system to perform atransaction required to execute the query, the selection being betweenthe soon-to-fail database system and the alternative database system,the soon-to-fail database system and the alternative database systemhaving the access to data necessary to perform the transaction.
 17. Thenon-transitory computer-readable storage medium of claim 15 wherein whenreporting the status concerning execution of the transaction by thesoon-to-fail database system the computer: reports the status to alogging subsystem.
 18. The non-transitory computer-readable storagemedium of claim 15 wherein when creating the query band for the requestthe computer derives an arbitrary string of characters from anidentification of the session and an identification of the request. 19.The non-transitory computer-readable storage medium of claim 18 whereinwhen deriving the arbitrary string of characters the computerconcatenates the identification of the session and the identification ofthe request.
 20. The non-transitory computer-readable storage medium ofclaim 18 wherein when deriving the arbitrary string of characters thecomputer uses a hash operation.
 21. The non-transitory computer-readablestorage medium of claim 18 wherein when deriving the arbitrary string ofcharacters the computer uses the time the request was submitted.